📄 renpassword.asp
字号:
<!--#include file="conn.asp"-->
<!--#Include File="WrSky_Sql.Asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<%if request.QueryString("action")="save" then%>
<!--#include file="../md5.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_admin where admin='"&session("admin")&"'",conn,1,3
if md5(trim(request("password")))<>rs("password") then
response.Write "<script language=javascript>alert('原密码错误,请返回重新输入');history.go(-1);</script>"
response.End
else
rs("password")=md5(trim(request("password2")))
rs.Update
rs.Close
set rs=nothing
session("admin")=""
session("flag")=""
response.Write "<script language=javascript>alert('更改成功,请用新密码重新登陆!');history.go(-1);</script>"
end if
response.End
end if
%>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<form name="renpassword" method="post" action="renpassword.asp?action=save">
<tr>
<td colspan="2" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">更改管理密码</font></b></td>
</tr>
<tr bgcolor="#E8F1FF">
<td width="40%" align="right">管理 I D:</td>
<td width="60%"> <font color=red><%=session("admin")%></font></td>
</tr>
<tr bgcolor="#E8F1FF">
<td align="right">原 密 码:</td>
<td> <input name="password" type="password" id="password" size="16"></td>
</tr>
<tr bgcolor="#E8F1FF">
<td align="right">新 密 码:</td>
<td> <input name="password1" type="password" id="password1" size="16"></td>
</tr>
<tr bgcolor="#E8F1FF">
<td align="right">确认密码:</td>
<td> <input name="password2" type="password" id="password2" size="16"></td>
</tr>
<tr bgcolor="#E8F1FF">
<td></td>
<td> <input onClick="return check();" type="submit" name="Submit" value="确定更改">
</td>
</tr>
</form>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
<script LANGUAGE="javascript">
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.renpassword.password.value)) {
document.renpassword.password.focus();
alert("原密码不能为空!");
return false;
}
if(checkspace(document.renpassword.password1.value)) {
document.renpassword.password1.focus();
alert("新密码不能为空!");
return false;
}
if(checkspace(document.renpassword.password2.value)) {
document.renpassword.password2.focus();
alert("确认密码不能为空!");
return false;
}
if(document.renpassword.password1.value != document.renpassword.password2.value) {
document.renpassword.password1.focus();
document.renpassword.password1.value = '';
document.renpassword.password2.value = '';
alert("新密码和确认密码不相同,请重新输入");
return false;
}
document.admininfo.submit();
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -