📄 setpassword.asp
字号:
<!--#include file="../inc/conn.asp"-->
<%
if session("chat_admin")<>"yes" then
response.redirect "login.asp"
response.end
else
username=trim(request.form("uname"))
opassword=trim(request.form("upsw"))
npassword=trim(request.form("npsw"))
npassword1=trim(request.form("npsw1"))
iadminname=""
Conn = DBCN()
set rs = Server.CreateObject("ADODB.Recordset")
sql="select Top 1 * from admin"
rs.open sql,conn,3,3
iadminname=rs("name")
err_str=""
if username<>"" then
if len(username)<4 then
err_str="帐号不能少于4个字符。"
elseif rs("password")<>opassword then
err_str="修改失败。你输入的原密码不对。"
elseif npassword<>npassword1 then
err_str="修改失败。新密码和确认密码不一样。"
elseif len(npassword)<4 then
err_str="修改失败。新密码不能少于4个字符。"
else
rs("name")=username
rs("password")=npassword
rs.update
err_str="修改管理员帐号和密码成功。<a href=""index.asp"">返回首页</a>"
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JChat注册用户管理</title>
<style type="text/css">
<!--
.p9 {font-size: 10pt; line-height: 14pt }
-->
</style>
</head>
<body topmargin="3" leftmargin="3">
<table border="0" width="100%" bgcolor="#C8C9D2">
<tr>
<td width="52%"><a href="index.asp">系统管理首页</a><strong>(设置管理员帐号和密码)</strong></td>
<td width="48%">
<p align="right" class="p9"><a href="logout.asp"><font color=red>退出系统</font></a> <a href="http://www.easyfad.com">技术支持</a> <a href="http://www.jchat.com.cn">关于JChat</a></td>
</tr>
</table>
<p align="center"> </p>
<form method="POST" action="setpassword.asp">
<div align="center"><center><table border="0" width="50%" bgcolor="#D9D9D9">
<tr>
<td width="100%" colspan="2" bgcolor="#B9B9B9">设置管理员帐号和密码
</td>
</tr>
<%
if err_str="" then
%>
<tr>
<td width="100%" colspan="2" height="10"></td>
</tr>
<tr>
<td width="40%" align="right">帐号:</td>
<td width="60%"><input type="text" name="uname" size="20" value="<%=iadminname%>"> </td>
</tr>
<tr>
<td width="40%" align="right">旧密码:</td>
<td width="60%"><input type="password" name="upsw" size="20"></td>
</tr>
<tr>
<td width="40%" align="right">新密码:</td>
<td width="60%"><input type="password" name="npsw" size="20"></td>
</tr>
<tr>
<td width="40%" align="right">确认新密码:</td>
<td width="60%"><input type="password" name="npsw1" size="20"></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center"><br>
<input type="submit" value="提 交" name="B1"> <input type="reset"
value="复 原" name="B2"> <input type="button"
value="返 回" onclick="history.back(0)"><br><br></td>
</tr>
<%
else
response.write "<tr><td height=100>" & err_str & " <input type=button value=""返 回"" onclick=""history.back();""></td></tr>"
end if
%>
</table>
</center></div>
</form>
</body>
</html>
<%
rs.close
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -