📄 controlpass.asp
字号:
<!--#include file="conn.asp""-->
<!--#include file="inc/md5.asp"-->
<%
Suc=True
Suc1=False
IF Request.Form.Count<>0 Then
OldPassword=Request.Form("OldPassword")
NewPassword=Request.Form("NewPassword")
ConfirmPassword=Request.Form("ConfirmPassword")
PasswordQuestion=Request.Form("PasswordQuestion")
PasswordAnswer=Request.Form("PasswordAnswer")
IF NewPassword<>"" Then
IF Len(Newpassword)<6 Then
ErrInfo=ErrInfo & "·您的密码不得少于六位!<BR>"
Suc=False
End IF
If NewpassWord<>ConfirmPassword Then
ErrInfo=Errinfo & "·新密码与确认密码不符,请更改!<BR>"
Suc=False
End IF
End IF
IF PasswordQuestion="" Then
ErrInfo=ErrInfo & "·密码提问不能为空!<BR>"
Suc=False
End IF
IF Suc Then
SQL="Select 密码,密码提示问题,密码提示答案 From 注册信息 Where 姓名='"& Session("User") & "'"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQL,Connstr,3,2
IF Not RS.Eof Then
IF RS("密码")<>md5(OldPassword) Then
ErrInfo=ErrInfo & "·您填写的旧密码不正确!<BR>"
Suc=False
End IF
ENd IF
End IF
IF Suc Then
IF NewPassword<>"" Then
RS("密码")=md5(NewPassword)
End IF
RS("密码提示问题")=PasswordQuestion
IF PasswordAnswer<>"" Then
RS("密码提示答案")=md5(PasswordAnswer)
End IF
RS.Update
Suc1=True
End IF
End IF
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<!--#include file="inc/css.asp"-->
<title><%=WebSiteName%></title>
</head>
<body topmargin="0" background="images/bg.gif">
<!--#include file="top.asp"-->
<div align="center">
<center>
<table border="0" width="755" cellspacing="0" cellpadding="0" height="341">
<tr>
<td width="189" style="background-color: #FFFFFF; border-left: 1 solid #000000; border-top: 1 solid #000000; border-bottom: 1 solid #000000" valign="top" height="341">
<!--#include file="cleft.asp"-->
</td>
<td width="562" style="background-color: #FFFFFF; border: 1 solid #000000" valign="top" height="341">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<font color="#545454"><b>
<a href="control.asp">
控制面板首页</a></b></font>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="controledit.asp">
编辑个人资料</a></b>
</td>
<td width="20%" height="25" bgcolor="#FFFFFF" style="border-right: 1 solid #000000" align="center">
<b>
<font color="#545454">
修改登录密码</font></b>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="controlmail.asp">
短消息信箱</a></b>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-bottom: 1 solid #000000" align="center">
<b>
<a href="controlfriend.asp">
好友列表</a></b>
</td>
</tr>
<tr>
<td width="100%" valign="middle" colspan="5" height="20">
</td>
</tr>
<%IF Suc And Suc1=False Then%>
<form action="" method="post">
<tr>
<td width="100%" valign="middle" colspan="5" height="5"><div align="center">
<center>
<table border="0" width="90%" cellspacing="0" cellpadding="0" style="border: 1 solid #000000">
<tr>
<td height="22" background="images/bg2.gif" width="500" colspan="2">
<p align="center"><b><font color="#FF0000">修改登录密码</font></b></p>
</td>
</tr>
<tr>
<td width="500" colspan="2" height="10">
</td>
</tr>
<%
SQL="Select 密码提示问题 From 注册信息 Where 姓名='"& Session("User") & "'"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQL,Connstr,1,1
IF Not RS.EOF Then
PasswordQuestion=RS("密码提示问题")
End IF
Set RS=Nothing
%>
<tr>
<td width="500" colspan="2" height="10">
<font color="#545454">注:如果不修改,密码、提问、回答请留空!</font></td>
</tr>
<tr>
<td width="500" colspan="2" height="10">
<p></td>
</tr>
<tr>
<td width="144" align="right" valign="bottom">原 来 密
码:</td>
<td width="354"><input type=password name="OldPassword" size=12 maxlength=16 style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 85; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%">
<font color="red">* </font>以前的旧密码</td>
</tr>
<tr>
<td width="144" align="right" valign="bottom">新 的 密
码:</td>
<td width="354"><input type=password name="NewPassword" size=12 maxlength=16 style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 85; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%">
<font color="red">*</font><font color="red"> </font>最少六位</td>
</tr>
<tr>
<td width="144" align="right" valign="bottom">确 认 密
码:</td>
<td width="354"><input type=password name="ConfirmPassword" size=12 maxlength=16 style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 85; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%">
<font color="red">*</font><font color="red"> </font>确认您的密码</td>
</tr>
<tr>
<td width="144" align="right" valign="bottom">密 码 提
问:</td>
<td width="354"><input type=text name="PasswordQuestion" size=12 maxlength=16 style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 85; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%" value="<%=PasswordQuestion%>">
<font color="red">*</font><font color="red"> </font>如:我的生日是多少?</td>
</tr>
<tr>
<td width="144" align="right" valign="bottom">回 答 提
问:</td>
<td width="354"><input type=text name="PasswordAnswer" size=12 maxlength=16 style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 85; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%">
<font color="red">*</font><font color="red"> </font>如:三月二十七日</td>
</tr>
<tr>
<td width="500" colspan="2" height="10"></td>
</tr>
<tr>
<td width="502" height="22" bgcolor="#EDEDED" style="border-top: 1 solid #000000" colspan="2">
<p align="center" style="margin-top: 5; margin-bottom: 5"><INPUT type=submit value=' 修 改 ' name=Submit style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 85; border: 1px groove #000000; background-position: 0% 50%">
<INPUT type=reset value=' 取 消 ' name=Submit style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 85; border: 1px groove #000000; background-position: 0% 50%"></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</Form>
<%ElseIF Suc=False And Suc1=False Then%>
<tr>
<td width="100%" valign="middle" colspan="5" height="5"><div align="center">
<center>
<table border="0" width="90%" cellspacing="0" cellpadding="0" style="border: 1 solid #000000">
<tr>
<td width="100%" background="images/bg2.gif" height="22">
<p align="center"><font color="#FF0000"><b>密码修改出错</b></font></td>
</tr>
<tr>
<td width="100%">
<p style="line-height: 150%; margin-left: 50; margin-top: 3; margin-bottom: 3"><font color=red><%=ErrInfo%></font>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
<%ElseIF Suc1=True Then%>
<tr>
<td width="100%" valign="middle" colspan="5" height="5">
<div align="center">
<center>
<table border="0" width="90%" cellspacing="0" cellpadding="0" style="border: 1 solid #000000">
<tr>
<td width="100%" background="images/bg2.gif" height="22">
<p align="center"><font color="#FF0000"><b>密码修改成功</b></font></td>
</tr>
<tr>
<td width="100%"><p style="line-height: 150%; margin-left: 5; margin-top: 20; margin-bottom: 20" align="center"> <font color=red><%=Session("User")%></font>,恭喜您!您已经成功修改密码,请选择其它操作!</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
<%End IF%>
<tr>
<td width="100%" valign="middle" colspan="5" height="5">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--#include file="bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -