📄 password.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file ="cook.asp"-->
<!--#include file ="conn.asp"-->
<!--#include file ="info.asp"-->
<script laguage="javascript">
<!--
function form1_onsubmit()
{
if (document.form1.rpws.value=="")
{
alert("旧密码不能为空!")
document.form1.rpws.focus()
return false
}
else if(document.form1.pws1.value=="")
{
alert("新密码不能为空!")
document.form1.pws1.focus()
return false
}
else if(document.form1.pws2.value=="")
{
alert("确认新密码不能为空!")
document.form1.pws2.focus()
return false
}
}
-->
</script>
<%
call htmltop()
%>
<table width="700" height="400" border="0" align="center" cellpadding="0" cellspacing="0" class="TdStyle">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF"><br><br><br>
<table width="400" border="0" cellpadding="5" cellspacing="1" bgcolor="#C0C0C0">
<form name="form1" method="post" action="password.asp" onsubmit="return form1_onsubmit()">
<tr align="center" bgcolor="#E3E3E3">
<td height="30" colspan="2"><B>修改密码</B></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="25" align="right">旧密码:</td>
<td width="300"><input name="rpws" type="text" size="30"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">新密码:</td>
<td><input name="pws1" type="text" size="30"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">确认新密码:</td>
<td><input name="pws2" type="text" size="30"></td>
</tr>
<tr align="center" bgcolor="#E3E3E3">
<td height="30" colspan="2">
<input type="submit" name="submit" value="提交">
<input type="reset" name="submit2" value="重置"></td>
</tr></form>
</table>
</td>
</tr>
</table>
<%
if request.form("submit")="提交" then
rpws=trim(request.form("rpws"))
pws1=trim(request.form("pws1"))
pws2=trim(request.form("pws2"))
if rpws="" or pws1="" or pws2="" then
response.write"<script>alert('新密码不能为空!');history.go(-1)</script>"
end if
if pws1<>pws2 then
response.write"<script>alert('两个新密码不一样!');history.go(-1)</script>"
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,3,3
if encrypt(rpws)<>rs("pws") then
response.write"<script>alert('旧密码不正确!');history.go(-1)</script>"
else
rs("pws")=encrypt(pws1)
rs.update
session.abandon()
response.write"<script>alert('密码更新成功,请重新登陆!');window.open('login.asp','_parent')</script>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
end if
call htmlend()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -