-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_user.php
More file actions
85 lines (80 loc) · 2.32 KB
/
Copy pathedit_user.php
File metadata and controls
85 lines (80 loc) · 2.32 KB
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
<?
//Set permission level
$req_permission = 5;
include"auth.php";
include"functions.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit User</title>
<?
//Set all pages for header
head("../..", "../css");
?>
</head>
<body>
<?
//Get user info
$id = $_GET['id'];
$user_query = "SELECT * FROM `users` WHERE `id` = $id LIMIT 0, 30 ";
$user_info = mysql_query($user_query);
$returned = mysql_num_rows($user_info);
//User found
if($returned == 1){
while( $row = mysql_fetch_array($user_info)){
//Get user info
$que_user = $row['username'];
$que_firstname = $row['firstname'];
$que_lastname = $row['lastname'];
$que_email = $row['email'];
$que_permissions = $row['permissions'];
$que_banned = $row['BANNED'];
}
?>
<form name="edituser" action="save_user.php" id="edituser" method="get">
<center>
<table align="center" class="edit_user" width="500">
<tr>
<td colspan="2">Eding user <? echo "$que_user"; ?></td>
</tr>
<tr bgcolor="#FF5900">
<th>Username</th>
<th><input type="text" name="username" width="200" value="<? echo "$que_user";?>" /></th>
</tr>
<tr bgcolor="#FF0000">
<td>First name</td>
<td><input type="text" name="firstname" width="200" value="<? echo $que_firstname; ?>" /></td>
</tr>
<tr bgcolor="#FF5900">
<td>Last name</td>
<td><input type="text" name="lastname" width="200" value="<? echo $que_lastname; ?>" /></td>
</tr>
<tr bgcolor="#FF0000">
<td>Email</td>
<td><input type="text" name="email" width="200" value="<? echo $que_email; ?>" /></td>
</tr>
<tr bgcolor="#FF5900">
<td>permissions</td>
<td><input type="text" name="permissions" width="200" value="<? echo $que_permissions; ?>" /></td>
</tr>
<tr bgcolor="#FF0000">
<td>Banned</td>
<td><input type="checkbox" name="banned" value="1" <? if($que_banned == 1){ echo " checked"; } ?> /> </td>
</tr>
<tr bgcolor="#FF5900">
<td colspan="2"><input type="submit" name="submit" value="Edit User" />
<input type="hidden" name="id" value="<? echo $id; ?>" /></td>
</tr>
</table>
</center>
</form>
<?
}else{
//User not found
echo "User with id of $id is not found";
}
?>
</body>
</html>