📄 modify_pwd.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="../inc/inc.asp" -->
<!--#include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改密码</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
if request.Form("submit")="确认修改" then
oldpwd=request.Form("oldpwd")
p=conn.execute("select count(EmpID) from user where password='"&oldpwd&"' and EmpID="&session("EmpID"))(0)
if p<1 then
response.Write("原始密码有误")
response.End()
end if
pwd=request.Form("newpwd")
pwd2=request.Form("newpwd2")
if pwd="" then
response.Write("新密码不能为空")
response.End()
end if
if instr(pwd,"'")>0 then
response.Write("新密码串里含有危险字符")
response.End()
end if
if pwd<>pwd2 then
response.Write("二次密码不正确")
response.End()
end if
conn.execute("update user set Password='"&pwd&"' where EmpID="&session("EmpID"))
%>
<script>
alert("密码修改成功");
window.location.href="modify_pwd.asp";
</script>
<%
end if
%>
<div class="div1" align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td colspan="2" align="center" class="tb_title">修改密码</td>
</tr>
<form method="post">
<tr class="tr_list1">
<td align="right">原始密码:</td>
<td align="left"><input name="oldpwd" type="password" id="oldpwd"></td>
</tr>
<tr class="tr_list2">
<td align="right">新 密 码:</td>
<td align="left"><input name="newpwd" type="password" id="newpwd"></td>
</tr>
<tr class="tr_list1">
<td align="right">确认密码:</td>
<td align="left"><input name="newpwd2" type="password" id="newpwd2"></td>
</tr>
<tr class="tr_list2">
<td align="left"> </td>
<td align="left"><input name="Submit" type="submit" onClick="return check()" class="tbb" value="确认修改"></td>
</tr>
</form>
</table>
</div>
<script>
function check(){
if (document.all.oldpwd.value.length<1){
alert("原始密码为空?");
document.all.oldpwd.focus();
return false;
}
if (document.all.newpwd.value.length<1){
alert("新密码不能为空!");
document.all.newpwd.focus();
return false;
}
if (document.all.newpwd.value!=document.all.newpwd2.value){
alert("新密码二次确认不一致!");
document.all.newpwd2.select();
return false;
}
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -