📄 admin_psw.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="top.asp"-->
<%
select case request.QueryString("act")
case "modify"
call update()
case else
call main()
end select
sub main()
if not session(Variable&Names)=Variable then
errinfo="你没有登录或已经退出登录"
error(errinfo)
exit sub
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=urlname%> - 修改密码</title>
</head>
<script language=javascript>
<!--
function check()
{
if(document.form.password.value=="")
{
alert("密码不能为空");
form.password.focus()
return false;
}
if(document.form.password2.value=="")
{
alert("确认密码不能为空");
form.password2.focus()
return false;
}
}
-->
</script>
<body>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#C1FFC1">
<tr>
<td>
<form action="?act=modify" method="POST" name="form" onSubmit="javascript:return check();">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="70%">
<tr>
<td width="50%" height="50%" align="center" valign="top">
<table width="55%" height="45%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
<tr>
<td height="30" colspan="2" align="center" >修改密码</td>
</tr>
<tr>
<td width="36%" height="30" align="right">新密码:</td>
<td width="64%"> <input name="password" type="password" size="20" class="style4"></td>
</tr>
<tr>
<td width="36%" height="30" align="right">确 认:</td>
<td> <input type="password" name="password2" size="20" class="style4"></td>
</tr><tr>
<td width="36%" height="30" align="right"> </td>
<td> <input type="submit" value="确 定" class="style3">
<input type="reset" value="重 置"class="style3"></td>
</tr>
</table><p align="center"><a href="javascript:history.back(-1)">返 回</a></p>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
end sub
sub update()
If Not ChkPost Then
errinfo="对不起,请不要从外部提交数据"
error(errinfo)
exit sub
End If
dim password,password2
password=md5(request("password"))
password2=md5(request("password2"))
if password<>password2 then
errinfo="两次输入的密码不一致,请重新输入"
error(errinfo)
exit sub
end if
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from admin where id=1"
rs.open sql,conn,3,2
rs.update
rs("password")=password
rs.update
rs.close
sucinfo="密码修改成功"
suc(sucinfo)
end sub
%>
<!--#include file="bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -