📄 admin_editpassword.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
if session("AdminName") = "" then
response.Redirect "Admin_Login.asp"
end if
If Request.QueryString("Flag")=1 Then
Dim Rs,Sql
Set Rs=Server.CreateObject("Adodb.Recordset")
Sql="Select * From admin Where password='"&md5(Trim(Request.Form("o_psd")),16)&"' and Username='"&session("AdminName")&"'"
Rs.Open Sql,Conn,1,1
If Not Rs.Bof And Not Rs.Eof Then
Set Rs1=Server.CreateObject("Adodb.Recordset")
Sql1="Select * From admin where Username='"&session("AdminName")&"'"
Rs1.Open Sql1,Conn,1,2
Rs1("password")=md5(Request.form("n_psd"),16)
Rs1.update
response.write"<SCRIPT language=JavaScript>alert('密码修改成功,请返回进行别的操作!');"
response.write"javascript:history.go(-1);</SCRIPT>"
response.end
Rs.close
Set Rs=nothing
Conn.close
Set conn=nothing
Else
response.write"<SCRIPT language=JavaScript>alert('原密码不正确,请重新输入!');"
response.write"javascript:history.go(-1);</SCRIPT>"
response.end
Rs.close
Set Rs=nothing
Conn.close
Set conn=nothing
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="css/index.css" type=text/css rel=stylesheet>
<title>管理栏目</title>
</head>
<body>
<script language="vbscript">
sub dd()
if zc1.o_psd.value="" then
msgbox "请输入原来的旧密码!",48,"注意!"
zc1.o_psd.focus()
exit sub
end if
if zc1.n_psd.value="" then
msgbox "请输入您想修改的密码!",48,"注意!"
zc1.n_psd.focus()
exit sub
end if
if len(zc1.n_psd.value )<6 or len(zc1.n_psd.value )>16 then
msgbox "密码长度要大于6小于16",48,"注意!"
zc1.n_psd.focus()
exit sub
end if
if zc1.n_psd.value<>zc1.n_psda.value then
msgbox "确认密码不能为空!或者"&vbcrlf&"是两次输入的密码不一样!",48,"注意!"
zc1.n_psda.focus()
exit sub
end if
zc1.submit()
end sub
-->
</script>
<form method="POST" action="admin_editpassword.asp?flag=1" name="zc1">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="65">
<tr>
<td width="100%" height="14"></td>
</tr>
<tr>
<td width="100%" height="14"></td>
</tr>
<tr>
<td width="100%" height="14">
<p align="center">-------------
当前操作:修改管理员密码 -------------</td>
</tr>
</center>
<tr>
<td width="100%" height="14"></td>
</tr>
<tr>
<td width="100%" height="14" align="center">原密码:<input type="text" name="o_psd" size="20"></td>
</tr>
<tr>
<td width="100%" height="11" align="center"> </td>
</tr>
<tr>
<td width="100%" height="11" align="center">新密码:<input type="password" name="n_psd" size="20"></td>
</tr>
<tr>
<td width="100%" height="14" align="center"> </td>
</tr>
<tr>
<td width="100%" height="14" align="center">确 认:<input type="password" name="n_psda" size="20"></td>
</tr>
<center>
<tr>
<td width="100%" height="14"></td>
</tr>
<tr>
<td width="100%" height="14">
<p align="center">----------------------------------------------------</td>
</tr>
<tr>
<td width="100%" height="12"> </td>
</tr>
<tr>
<td width="100%" height="14">
<p align="center"><input type="button" value=" 确 认 " name="B1" onclick="dd()">
<input type="reset" value="全部重写" name="B2"></td>
</tr>
<tr>
<td width="100%" height="14"></td>
</tr>
</table>
</center>
</div>
<p> </p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -