[help] Page wont display

Posted on Wednesday 11th June 2008 at 02:29 AM
Adam981
Adam981's Avatar
Well im trying to add a ban system to my site, and just isnt working..

banadmin.php
PHP Code
  1. <?
  2. session_start();
  3. include("config.php");
  4. if($logged[username] && $logged[userlevel] == 6)
  5. {
  6. if($_GET[user])
  7. {
  8. if (!$_POST[update]) // if the submit button is pressed
  9. {
  10. echo("
  11. <form method="POST">
  12. <select size="1" name="type">
  13. <option selected value="1">1 Hour</option>
  14. <option value="2">2 Hour</option>
  15. <option value="3">3 Hour</option>
  16. <option value="4">4 Hour</option>
  17. <option value="5">5 Hour</option>
  18. <option value="6">6 Hour</option>
  19. <option value="7">7 Hour</option>
  20. <option value="8">8 Hour</option>
  21. <option value="9">9 Hour</option>
  22. <option value="10">10 Hour</option>
  23. <option value="11">11 Hour</option>
  24. <option value="12">12 Hour</option>
  25. <option value="13">13 Hour</option>
  26. <option value="14">14 Hour</option>
  27. <option value="15">15 Hour</option>
  28. <option value="16">16 Hour</option>
  29. <option value="17">17 Hour</option>
  30. <option value="18">18 Hour</option>
  31. <option value="19">19 Hour</option>
  32. <option value="20">20 Hour</option>
  33. <option value="21">21 Hour</option>
  34. <option value="22">22 Hour</option>
  35. <option value="23">23 Hour</option>
  36. <option value="24">24 Hour</option>
  37. <option value="36">36 Hour</option>
  38. <option value="48">2 Day Ban</option>
  39. <option value="168">7 day ban</option>
  40. </select></p>
  41.  
  42. <p>
  43. Reason/violation:</p>
  44.  
  45. <p><textarea rows="4" name="reason" cols="22"></textarea></p>
  46.  
  47. <input type="submit" name="update" value="Update"></td>
  48.  
  49. </form>
  50. ");// ends the echo
  51. }
  52. else
  53. {
  54. $type = htmlspecialchars($_POST[type]); // posts the type of ban
  55. $reason = htmlspecialchars($_POST[reason]); //posts the reason
  56. echo ("$_GET[user] has been banned. This ban will be lifted automaticly."); // display's message
  57. $update = mysql_query("Update users set bannedhours = '$type',
  58. reason = '$reason', banned = 'yes' where username = '$_GET[user]'"); // updates the database
  59. }
  60. }
  61. else
  62. {
  63. $getusers = mysql_query("Select * from users order by username asc"); // gets the users
  64. while($users = mysql_fetch_array($getusers))
  65. {
  66. echo("<a href="banadmin.php?user=$users[username]">$users[username]</a>"); // display's all users
  67. }
  68. }
  69. }
  70. else // if your not admin
  71. {
  72. echo("Sorry, but your not allowed to view this page. piss of now."); // display's message if your not admin or not logged in
  73. }
  74. ?>


banned.php
PHP Code
  1. <?
  2. session_start();
  3. include("config.php");
  4. if($logged[username] && $logged[banned] ==yes) // lets the banned preview :)
  5. {
  6. setcookie("id", 2132421,time()+(60*60*24*5), "/", "");
  7. setcookie("pass", loggedout,time()+(60*60*24*5), "/", ""); // logs em out
  8. echo ("A moderator has banned you for $logged[reason]. Your ban will be lifted in $logged[bannedhours] Hours. If this is not correct please contact us. "); // tells em about their bann
  9. }
  10. else
  11. {
  12. echo("You are not banned you froob"); //tells em to get lost
  13. }
  14. ?>


Hope somone can help me.
Posted on Wednesday 11th June 2008 at 10:48 AM
ilyas-shezad
ilyas-shezad's Avatar
whats wrong with it?
session timed out?
PHP-MYSQL-JAVASCRIPT-ACTIONSCRIPT-CSS-HTML
Making tutorials for flash, php and javascript
Login or register to respond to this forum topic.