<!--#include file="chklogin.asp"-->
<!--#include file="../conn.asp"-->
<!--#include file="../md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理密码修改</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FF9999">
<br>
<br>
<br>
<br>
<br>
<%
dim psd,psd2,chang
psd=request.Form("psd")
psd2=request.Form("psd2")

if request.QueryString("chang")=1 then
call changpsd()
end if

sub changpsd()
if psd="" or psd2="" then
response.Write("&nbsp;&nbsp;密码不能为空！")
response.End()
end if

if psd=psd2 then
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from kw_admin where id="&request.QueryString("id")
rs.open sql,conn,1,3
rs("userpsd")=md5(psd,16)
rs.update
response.write "<script language=javascript>alert('密码修改成功');history.go(-1);</script>"
response.End
else
response.Write("&nbsp;&nbsp;两次密码不相同！")
response.End()
end if
end sub
%>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
  <form action="changpsd.asp?chang=1&id=<%=session("uid")%>" method="post">
  <tr bgcolor="#ff6666">
    <td height="30" colspan="2">&nbsp;</td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td width="128" height="30">用户密码</td>
    <td width="269"><input name="psd" type="password" id="psd" size="30"></td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td height="30">确认密码</td>
    <td><input name="psd2" type="password" id="psd2" size="30"></td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td height="30" colspan="2"><input type="submit" name="Submit" value="确 认"></td>
  </tr>
  </form>
</table>
</body>
</html>
