PHP:
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
75
76
77
78
79
80
81
82
83
84
85
| <? //Login to admin $admin = "meester"; $adminpass = "1234"; if($username) { if(!$password){ die("Enter a password<br><a href=\"javascript:history.go(-1)\">Back</a>"); } if($username != $admin){ die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>"); } if($password != $adminpass){ die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>"); } } if(!$username){ ?> <form method="post"> <table> <tr><td>enter in your username and password</font></td></tr> <tr><td>username</td><td><input type=text name=username maxlength=150></td></tr> <tr><td>password</td><td><input type=password name=password></td></tr> <tr><td><input type=submit value="login"></td></tr> </table> </form> <?php die(""); } //This is where adminpage starts include("function.php"); connect(); //staat in function.php //Html header ?> <html><head><title>Admin page</title></head><body><form> <table border='0' cellpadding='0' cellspacing='0' width='100%'><tr> <td width='3%'></td> <td width='12%'>Username</td> <td width='10%'>Password</td> <td width='18%'>Name</td> <td width='19%'>E-mail</td> <td width='30%'>Ip-adres</td> <td width='5%'>Banned</td> </tr></table> <? //querie $sql = "SELECT * FROM members ORDER BY id DESC"; $sql2 = mysql_query($sql); while ($record = mysql_fetch_object($sql2)) { //data from database $username = "$record->username"; $password = "$record->password"; $name = "$record->name"; $email = "$record->email"; $ip = "$record->ip"; $banned = "$record->banned"; //Template for output print"<!--table for users-->"; print"<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>"; print"<td width='3%'>"; print"<p align='center'><font size='1' face='Verdana'>"; print"<input type='checkbox' name='select' value='select'></font></p></td>"; print"<td width='12%'>$username</td>"; print"<td width='10%'>$password</td>"; print"<td width='18%'>$name</td>"; print"<td width='19%'>$email</td>"; print"<td width='30%'>$ip</td>"; print"<td width='5%'>$banned</td>"; print"</tr>"; print"</table>"; print"<!--end of table-->"; }//Everything before this is foreach record in db! //html einde en buttons 'ban','delete' ?><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr> <td width='5%'></td><td width='95%'><input type="submit" value="ban" name="Ban"><input type="submit" value="delete" name="delete"> </td></tr></table> </form></body></html> <? //Thw adminpage end! ?> |
Volgens mij heb ik het een beetje te moeilijk gemaakt voor mezelf! Kprobeer een admin te maken voor memberssysteem.
Hij list alle gebruikers in in regels onder elkaar met een selectbox ervoor.
Als ik op 'ban' of 'delete' button druk, kom ik terug bij admin login...
Oke das wel op te lossen denk ik door iemand, maare hij 'delete' of 'banned' ook niet? Wie o wie kan me helpen de eindjes aan elkaar te knopen?