-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditUser.php
51 lines (43 loc) · 2.22 KB
/
editUser.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
<?
require("sessionCheck.php");
require("config.php");
?>
<html>
<?
print $pageStyle;
?>
<?
//print "Accesslevel = $accesslevel || ". $_SESSION["accesslevel"] . "<br>\n";
//print "IP = $ip || " . $_SESSION["ip"] ."<br>\n";
if ($accesslevel > 1 ) {
// To low access.
print "<h1>UN-AUTHORIZED!</H1>";
print "Event has been logged, and sysadmin contacted.";
exit;
}
$ID= $_GET["ID"];
$Connect = mysqli_connect($DB_SERVER, $user, $password) or die ("Cant connect to MySQL at $DB_SERVER");
mysqli_select_db($DATABASE,$Connect) or die ("Cant connect to $DATABASE database");
$sql_query="SELECT * FROM access where id=".$ID;
$result=mysqli_query($sql_query) or die ("Error in mysql query: $sql_query \n" . mysqli_error() ."<br>\n");
$row=mysqli_fetch_array($result);
?>
<form action="updateUser.php?SID=<? print $sid;?>&ID=<? print $ID; ?>" method="POST" target="view">
<table BORDER >
<tr><td bgcolor = D3DCE3><div align=right>UserName</div></td><td><input name="uname" type="text" size="20" maxlength="80" value="<? print $row["uname"]; ?>"></td></tr>
<tr><td bgcolor = D3DCE3><div align=right>Password</div></td><td><input name="passwd" type="password" size="20" maxlength="80" value="<? print $row["passwd"]; ?>"></td></tr>
<tr><td bgcolor = D3DCE3><div align=right>Status</div></td><td>
<select name = "status" >
<option value="0" <? if ($row["status"]==0) { print "selected";}?> >Public</option>
<option value="1" <? if ($row["status"]==1) { print "selected";}?>>Members</option>
<option value="2" <? if ($row["status"]==2) { print "selected";}?>>Admin</option>
</select>
</td></tr>
<tr><td bgcolor = D3DCE3><div align=right>Comment</div></td><td><input name="comment" type="text" size="20" maxlength="80" value="<? print $row["comment"]; ?>"></td></tr>
<tr><td bgcolor = D3DCE3><div align=right>Name</div></td><td><input name="name" type="text" size="30" maxlength="80" value="<? print $row["Name"]; ?>"></td></tr>
<tr><td bgcolor = D3DCE3><div align=right>Email</div></td><td><input name="email" type="text" size="30" maxlength="80" value="<? print $row["Email"]; ?>"></td></tr>
<tr><td><input type="submit" value="Update User"></td><td><input type="reset" value="Reset"></td></td>
<input type="hidden" name=id value=<? print $ID;?>>
</table>
</form>
</html>