<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="../inc/msgbox.asp" -->
<!--#INCLUDE FILE="../inc/MD5.asp" -->
<title>密码修改页面</title>
<%
userID= session("user_id")
if userID="" then
msgbox "您还没有登陆，系统自动返回首页","../"
response.end
end if
oldpass=MD5(request.form("oldpass"))
newpass=MD5(request.form("newpass"))
renewpass=MD5(request.form("renewpass"))
if oldpass<>"D41D8CD98F00B204E9800998ECF8427E" then
if newpass="D41D8CD98F00B204E9800998ECF8427E" then
msgbox "新密码不能为空字符","back"
response.end
end if
if newpass<>renewpass then
msgbox "两次密码输入不一样","back"
response.end
end if
exec="select * from user where userID='"&userID&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if rs("password")<>oldpass then
msgbox "原始密码错误！","back"
response.end
end if
'修改密码程序
sql="update user set password='"+newpass+"' where userID='"&userID&"'"
conn.execute sql
msgbox "修改密码成功","close"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
%>
<html>
<head>
<meta http-equiv="expires" content="0">
<Meta http-equiv="Pragma" Content="No-cach">
</head>
<body>
<table width="250" height="150" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
        <form name="form1" method="post" action=""><tr>
    <td bgcolor="#99CC00">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="250" border="0" cellspacing="0" cellpadding="3">
      <tr>
        <td width="59">原始密码</td>
        <td width="179"><input name="oldpass" type="password" id="oldpass" value="" size="20"></td>
      </tr>
      <tr>
        <td>新的密码</td>
        <td><input name="newpass" type="password" id="newpass" size="20" maxlength="20"></td>
      </tr>
      <tr>
        <td>重复密码</td>
        <td><input name="renewpass" type="password" id="renewpass" size="20" maxlength="20"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#99CC00"><input type="submit" name="Submit" value="提交">

        <input type="button" name="Submit" value="取消" onClick="window.close()">
    </td>
  </tr></form>
</table>
</body>
</html>