SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | ||
| 3 | require(__DIR__."/globals.php"); | |
| 4 | ||
| 5 | $titles = array( | |
| 6 | - | mysql_query("INSERT INTO suggestions
|
| 6 | + | 'Gangs', |
| 7 | - | VALUES('','{$_POST['suggestionsTITLE']}',unix_timestamp(),'{$_POST['suggestions']}','No','N/A','{$ir['username']}
|
| 7 | + | 'Gym', |
| 8 | 'Players', | |
| 9 | 'Staff', | |
| 10 | 'Crimes', | |
| 11 | 'Profiles', | |
| 12 | 'Referrals', | |
| 13 | 'General', | |
| 14 | 'Other' | |
| 15 | ); | |
| 16 | ||
| 17 | - | <select name='suggestionsTITLE' type='dropdown'> |
| 17 | + | function mres($str) {
|
| 18 | - | <option value='Gangs'>Gangs</option> |
| 18 | + | return mysql_real_escape_string($str); |
| 19 | - | <option value='Gym'>Gym</option> |
| 19 | + | |
| 20 | - | <option value='Players'>Players</option> |
| 20 | + | |
| 21 | - | <option value='Staff'>Staff</option> |
| 21 | + | |
| 22 | - | <option value='Crimes'>Crimes</option> |
| 22 | + | $_POST['title'] = isset($_POST['title']) && ctype_alpha($_POST['title']) && in_array($_POST['title'], $titles) ? $_POST['title'] : null; |
| 23 | - | <option value='Profiles'>Profiles</option> |
| 23 | + | if(empty($_POST['title'])) |
| 24 | - | <option value='Referrals'>Referrals</option> |
| 24 | + | echo "Invalid Choice."; |
| 25 | - | <option value='General'>General</option> |
| 25 | + | mysql_query("INSERT INTO `suggestions`
|
| 26 | - | <option value='Other'>Other</option> |
| 26 | + | VALUES('','".$_POST['title']."',unix_timestamp(),'".mres($_POST['suggestions'])."','No','N/A','{$ir['username']}
|
| 27 | [{$ir['userid']}]')",$c) or die("Your suggestion processing has sensed an error, please click back and fix it.<br />
| |
| 28 | -<a href='suggestion.php'>Back</a><br />"); | |
| 29 | print "Your suggestion has been added!<br /> | |
| 30 | <a href='suggestions.php'>> Back</a><br />"; | |
| 31 | } | |
| 32 | else {
| |
| 33 | print "<h3>Add Suggestion</h3><br /> | |
| 34 | <hr width=50% /><b><font color=red>Do not post things that are NOT ideas or suggestions!</font></b><hr width=50% /><br /> | |
| 35 | Suggestion Category: | |
| 36 | <select name='title' type='dropdown'> | |
| 37 | ".foreach($titles as $opt) | |
| 38 | printf("<option value='%1\$s'>%1\$s</option>", $opt)."
| |
| 39 | </select><br /><br /> | |
| 40 | <form method='post' action=''> | |
| 41 | Suggestion:<br /> | |
| 42 | <textarea rows='7' cols='40' name='suggestions'></textarea><br /> | |
| 43 | <input type='submit' name='suggestions' value='Process' /> | |
| 44 | </form>"; | |
| 45 | } | |
| 46 | $h->endpage(); | |
| 47 | ?> |