📄 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="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4%"><img src="images/skin/t-tl.gif" width="31" height="29"></td>
<td width="91%" background="images/skin/t-tc.gif"> </td>
<td width="5%"><img src="images/skin/t-tr.gif" width="35" height="29"></td>
</tr>
<tr>
<td background="images/skin/t-lt.gif"> </td>
<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="85%" height="45%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#cad6eb" style="border-collapse: collapse">
<tr>
<td height="30" colspan="2" align="center" background="images/skin/t-tc.gif" bgcolor="#F4F6FC">修改密码</td>
</tr>
<tr>
<td width="15%" height="30" align="center">新密码</td>
<td width="85%"> <input name="password" type="password" size="25"></td>
</tr>
<tr>
<td width="15%" height="30" align="center">确 认</td>
<td> <input type="password" name="password2" size="25"></td>
</tr><tr>
<td width="15%" height="30" align="center"> </td>
<td> <input type="submit" value="确 定">
<input type="reset" value="重 置"></td>
</tr>
</table><p align="center"><a href="javascript:history.back(-1)">返 回</a></p>
</td>
</tr>
</table>
</form>
</td>
<td background="images/skin/t-rt.gif"> </td>
</tr>
<tr>
<td><img src="images/skin/t-bl.gif" width="31" height="32"></td>
<td background="images/skin/t-bc.gif"></td>
<td><img src="images/skin/t-br.gif" width="35" height="32"></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 + -