forked from zhengyong100/ji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzhanghao.php
97 lines (82 loc) · 3.36 KB
/
zhanghao.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
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include_once("shangmian.php");
?>
<table align="center" width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor='#B3B3B3' class='table table-striped table-bordered'>
<tr>
<td bgcolor="#EBEBEB"> 账号管理</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<form action="" method="post" name="submitxiugai">
<?php $sqlzhanghu = "SELECT * FROM jizhang_user where uid='$_SESSION[uid]'";
$result2 = mysql_query($sqlzhanghu);
$row = mysql_fetch_array($result2);
?>
<script language="javascript">
<!--
function linkok(url){
question = confirm("数据即将清除,确认吗?");
if (question){
window.location.href = url;
}
}
//-->
</script>
用户名:<?echo $row[username]; ?> <!-- <a href="javascript:linkok('shanchu.php?uid=$_SESSION[uid]')">清除全部数据</a>(操作前请备份导出)--><br /><br />
注册时间:<?echo date("Y-m-d H:i",$row[utime]); ?><br /><br />
电子邮箱 <input for="Email" name="email" id="email" value="<?echo $row[email]; ?>"> <br /><br />
旧密码:<input type="password" name="jiupassword" id="jiupassword" size="18" maxlength="15" /><br /><br />
新密码:<input type="password" name="password" id="password" size="18" maxlength="15" /> *(最多15个字符) <br /><br />
<input name="Submitxiugai" type="submit" value="提交" class="btn btn-default" />
<?php
if($_POST[Submitxiugai]){
$jiumima=md5($_POST[jiupassword]);
if($jiumima==$row[password]){
if($_POST[password]<>""){
$umima=md5($_POST[password]);
}else{
$umima=$jiumima;
}
$sql="update jizhang_user set password='$umima',email='$_POST[email]' where uid='$_SESSION[uid]'";
$query=mysql_query($sql);
if($query){
echo "<font color='green'>OK,修改成功!需要重新登陆,马上为你跳转。。</font><meta http-equiv=refresh content='2; url=index.php'>";
}else{
echo "<font color='red'>出错啦,写入数据库时出错!</font>";
}
}else{
echo "<font color='red'>密码不能为空或旧密码错误!</font>";
exit();
}
}
?>
</form>
</td>
</tr>
</table>
<table align="center" width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor='#B3B3B3' class='table table-striped table-bordered'>
<tr>
<td bgcolor="#EBEBEB"> 清空全部数据</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
密码:<input type="password" name="mimayanzheng" id="mimayanzheng" size="18" maxlength="15" /> (操作前请备份导出)<br /><br />
<input name="shangchushuju" type="submit" value="清除全部数据" class="btn btn-default" />
<?php
if($_POST[shangchushuju]){
$mmyanzheng=md5($_POST[mimayanzheng]);
if($mmyanzheng==$row[password]){
echo "<meta http-equiv=refresh content='2; url=shanchu.php?uid=".$_SESSION[uid].")'>";
echo "<font color='green'>已全部删除成功!</font>";
}else{
echo "<font color='red'>密码错误!</font>";
}
}
?>
<br /><br />
</td>
</tr>
</table>
<?php
include_once("xiamian.php");
?>