📄 chgpws.asp
字号:
<%Response.Expires=0
DIM Cookie
Cookie=Session.SessionID
if Cookie="" then Response.Write "没有权限" : Response.end
%>
<!--#include file="conn.asp"-->
<%
sql="select username,grade,score,times from Chatuser where SessionID='"&Cookie&"'"
set rs=conn.execute(sql)
if rs.eof then
Session("usernickname")="您是未注册用户"
Session("class")=0
Session("score")=0
Session("times")=0
else
Session("usernickname")=rs("username")
Session("class")=rs("grade")
Session("score")=rs("score")
Session("times")=rs("times")
Connection.Close
end if
dim class1
class1=Session("class")
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>更改口令</title>
<style type="text/css">
<!--
body {font-size : 10.5pt;}
td {font-size : 10.5pt;}
input {font-size : 10.5pt;}
-->
</style>
</head>
<body bgcolor="#EBF4D5">
<%
if Session("usernickname")="您是未注册用户" then
Response.Write "<title>系统提示</title>"
Response.write "<body bgcolor=#DBEEB5><p> </p><p align='center'>出错提示:<font color=#FF0000>您是未注册用户,不能修改密码。</p>"
Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里返回</a></p></body>"
Response.end
end if
DIM username,chg,password1,password2
username=Session("usernickname")
password1=Request.Form("password1")
password2=Request.Form("password2")
chg=Request.Form("enter")
if chg="更改密码" then
if password1="" then '检查新密码是否为空
Response.Write "<title>修改密码出错提示</title>"
Response.write "<body bgcolor=#DBEEB5><p> </p><p align='center'>出错提示:<font color=#FF0000>“新密码”</font>不能为空! </p>"
Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里进行修改</a></p></body>"
Response.end
end if
if password1<>password2 then '检查新密码和密码是否一致
Response.Write "<title>修改密码出错提示</title>"
Response.write "<body bgcolor=#DBEEB5><p> </p><p align='center'>出错提示:<font color=#FF0000>两次输入密码不一致,请重新输入</p>"
Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里返回</a></p></body>"
Response.end
end if
Dim temppass,templen,mmnewpass,j
temppass=StrReverse(password1)
templen=len(password1)
mmnewpass=""
for j=1 to templen
mmnewpass=mmnewpass+chr(asc(mid(temppass,j,1))-templen+int(j*1.1))
next
Set rs = Conn.Execute( "update chatuser set userpassword='"&mmnewpass&"' where username='"&username&"'" )
rs.Close
Response.Write "<title>成功修改密码</title>"
Response.write "<body bgcolor=#DBEEB5><p> </p><br><p align=center>密码修改成功,请牢记您的密码!</p>"
Response.write "<p align='center'><a href='javascript:window.close();'>点击这里关闭</a></p></body>"
Response.end
end if
%>
<br>
<br>
<form method="post" action="chgpws.asp">
<table width="275" border="1" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="1" bgcolor="E0E0E0" align="center">
<tr height="80"><td>
<table border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width="95" height="35"> 输入新密码:</td>
<td width="80">
<input maxlength="10" name="password1" size="10" type="password" tabindex="1" style="width: 70; background-color: #dAFfdF; border: 1 solid #20663B">
</td>
</tr>
<tr>
<td>请重新输入:</td>
<td>
<input maxLength="10" name="password2" size="10" type="password" tabIndex="2" style="width: 70; background-color: #dAFfdF; border: 1 solid #20663B""></td>
</tr>
</table>
</td></tr>
<tr>
<td align=center height=50 bgcolor=#f0f0f0>
<input name="enter" type="submit" value="更改密码" border-style: solid; border-width: 0; HEIGHT:20px;">
<input name="close" onclick=javascript:window.close() type="button" value="关闭返回" border-style: solid; border-width: 0; HEIGHT:20px;">
</td>
</tr></table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -