📄 adminpwd.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit%>
<!--#include file="conn.asp"-->
<%
if request("action") = "确 定" then
dim rs, sql
dim OldPassword
dim newPassword
dim newPassword1
dim ErrMsg
dim FoundError
ErrMsg = ""
FoundError=false
oldPassword=request("oldpasswd")
newPassword=request("newpasswd")
newPassword1=request("newpasswd1")
if newPassword="" or len(newPassword)>10 then
FoundError=True
ErrMsg=ErrMsg & "<li>新的口令不能为空并且长度不能大于10!</li>"
else
if newPassword<>newPassword1 then
FoundError=true
ErrMsg=ErrMsg & "<li>两次输入的口令不符!</li>"
else
set rs=server.createobject("adodb.recordset")
sql="select * from siteman where pwd ='"&OldPassword&"'"
rs.open sql,conn,1,1
if err.number<>0 then
response.write "数据库操作失败:"&err.description
err.clear
else
if rs.bof and rs.eof then
FoundError=true
ErrMsg=ErrMsg & "<li>密码错误!</li>"
else
sql = "UPDATE siteman SET pwd = '" + newPassword + "'"
conn.execute sql
if not err.number<>0 then
response.write "<p align=center>密码修改成功</p>"+chr(13)+chr(10)
else
FoundError=true
ErrMsg=ErrMsg & "<li>数据库操作失败,请以后再试!<br>"
ErrMsg = ErrMsg + err.Description + "</li>"
err.clear
end if
end if
end if
end if 'if newPassword<>newPassword1 then
end if 'if newPassword="" or len(newPassword)>10 then
if FoundError then
response.write "<ul>"
response.write ErrMsg
response.write "</ul>"
end if
end if 'if request("action") = "确 定" then
%>
<html>
<head>
<title>易得新闻中心密码修改</title>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../common.css">
</head>
<body>
<div align="center">
<center>
<table border="0" width="44%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#000000"><table border="0" width="100%" cellspacing="1" cellpadding="2">
<tr>
<td width="100%" bgcolor="#F4CF9D">
<p align="center">新闻中心管理密码更改</td>
</tr>
<tr>
<td width="100%" bgcolor="#FEF7ED"><form method="POST" name="frmChangePass" action="adminpwd.asp">
<p align="center">旧 密 码: <input name="oldpasswd" size="10" maxlength="10" type="password" value><br>
新 密 码: <input name="newpasswd" size="10" maxlength="10" type="password" value><br>
密码校验: <input name="newpasswd1" size="10" maxlength="10" type="password" value><br>
<input type="submit" value="确 定" name="action"> <input type="reset" value="清 除" name="action"></p>
</td>
</tr>
</table></td>
</tr>
</table>
</center>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -