Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 330
0 Users 2 Guests Online
Forum Index » PHP + MySQL » [help] Page wont display
Posted on Wednesday 11th June 2008 at 02:29 AM
Adam981
templates/default/images/noavatar.png's Avatar
Junior Member
Well im trying to add a ban system to my site, and just isnt working..

banadmin.php
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?
session_start
();
include(
"config.php");
if(
$logged[username] && $logged[userlevel] == 6)  
{
if(
$_GET[user])
{
if (!
$_POST[update]) // if the submit button is pressed
{
echo(
"
<form method=\"POST\">
<select size=\"1\" name=\"type\">
  <option selected value=\"1\">1 Hour</option>
  <option value=\"2\">2 Hour</option>
  <option value=\"3\">3 Hour</option>
  <option value=\"4\">4 Hour</option>
  <option value=\"5\">5 Hour</option>
  <option value=\"6\">6 Hour</option>
  <option value=\"7\">7 Hour</option>
  <option value=\"8\">8 Hour</option>
  <option value=\"9\">9 Hour</option>
  <option value=\"10\">10 Hour</option>
  <option value=\"11\">11 Hour</option>
  <option value=\"12\">12 Hour</option>
  <option value=\"13\">13 Hour</option>
  <option value=\"14\">14 Hour</option>
  <option value=\"15\">15 Hour</option>
  <option value=\"16\">16 Hour</option>
  <option value=\"17\">17 Hour</option>
  <option value=\"18\">18 Hour</option>
  <option value=\"19\">19 Hour</option>
  <option value=\"20\">20 Hour</option>
  <option value=\"21\">21 Hour</option>
  <option value=\"22\">22 Hour</option>
  <option value=\"23\">23 Hour</option>
  <option value=\"24\">24 Hour</option>
  <option value=\"36\">36 Hour</option>
  <option value=\"48\">2 Day Ban</option>
  <option value=\"168\">7 day ban</option>
</select></p>

<p>
  Reason/violation:</p>

<p><textarea rows=\"4\" name=\"reason\" cols=\"22\"></textarea></p>

<input type=\"submit\" name=\"update\" value=\"Update\"></td>

</form>
"
);// ends the echo
}
else
{
$type htmlspecialchars($_POST[type]); // posts the type of ban
$reason htmlspecialchars($_POST[reason]); //posts the reason
echo ("$_GET[user] has been banned. This ban will be lifted automaticly."); // display's message
$update mysql_query("Update users set bannedhours = '$type',
reason = '
$reason', banned = 'yes' where username = '$_GET[user]'"); // updates the database
}
}
else
{
$getusers mysql_query("Select * from users order by username asc"); // gets the users
while($users mysql_fetch_array($getusers))
{
echo(
"<a href=\"banadmin.php?user=$users[username]\">$users[username]</a>"); // display's all users
}
}
}
else 
// if your not admin
{
echo(
"Sorry, but your not allowed to view this page. piss of now."); // display's message if your not admin or not logged in
}
?>


banned.php
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?
   session_start
();
   include(
"config.php");
  if(
$logged[username] && $logged[banned] ==yes// lets the banned preview :)
{
      
setcookie("id"2132421,time()+(60*60*24*5), "/"""); 
      
setcookie("pass"loggedout,time()+(60*60*24*5), "/"""); // logs em out
      
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
   
}
   else
   {
      echo(
"You are not banned you froob"); //tells em to get lost
   
}
?>


Hope somone can help me.
Posted on Wednesday 11th June 2008 at 10:48 AM
ilyas-shezad
templates/default/images/noavatar.png's Avatar
Junior Member
whats wrong with it?
session timed out?