<!--#include file="conn.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="bbsuser.asp"-->
<%
userid=request.cookies("clubuser_id")
if request.form("newpwd1")<>"" then
   password=CheckStr(request.form("newpwd1"))
   oldpwd=CheckStr(request.form("oldpwd"))
   sql="select top 1 clubuser_password from clubuser where clubuser_password='"&md5(oldpwd)&"' and clubuser_id="&userid
   set rs1=server.createobject("adodb.recordset")
   rs1.open sql,conn,3,1
   if not rs1.eof then
   str="update clubuser set clubuser_password='"&md5(password)&"' where clubuser_id="&userid
   conn.execute str
   msg="(<font color=red>密码修改成功!</font>)"
   else
   msg="(<font color=red>你的旧密码不正确,修改不成功!</font>)"
   end if
end if
sql="select clubuser_name,clubuser_password,userimg,homepagetitle,cssfile,bokeer from clubuser where clubuser_id="&userid
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
if not rs.eof then
   username=rs("clubuser_name")
   userimg=rs("userimg")
   homepagetitle=rs("homepagetitle")
   cssfile="blogcss/"&rs("cssfile")
   bokeer=rs("bokeer")
   if cssfile="blogcss/" then cssfile="blogcss/2.css"
   if isNull(rs("userimg")) then
      blogheadimg="blogimages/nophoto.gif"
   else
      blogheadimg="userheadimg/"&rs("userimg")
   end if
end if
%>
<html><head><meta http-equiv=content-type content="text/html; charset=gb2312">
</head>
<script language="javascript">
<!--
	function check(form)
	{
    if (form.oldpwd.value=="")
    	{
    		alert("请填写旧密码！");
    		form.oldpwd.focus();
    		return false;
  	}
    if (form.newpwd1.value=="")
    	{
    		alert("请填写新密码！");
    		form.newpwd1.focus();
    		return false;
  	}
    if (form.newpwd2.value=="")
    	{
    		alert("请填写确认密码！");
    		form.newpwd2.focus();
    		return false;
  	}
    if (form.newpwd1.value!=form.newpwd2.value)
    	{
    		alert("新密码和新密码确认不一致！");
    		form.newpwd2.focus();
    		return false;
  	}
   return true;
	}
//-->
</script>
<body>
<center>
<title>修改密码</title>
<link rel="stylesheet" type="text/css" href="<%=cssfile%>">
<!--#include file="usernav.asp" -->
<!--#include file="myhead.asp" -->
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td width="22%" valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<!--#include file="usercalog.asp" -->
</div>
</td>
<td width="78%" valign="top" class="c2t1">
<div id="m_blog" class="modbox"><br>
              <br>
              <br>
              <br>
              <table width="80%" border="0" align="center">
                <form name="form1" method="post" action="" onsubmit="return check(this)">
                  <tr> 
                    <td height="30"><div align="center"></div></td>
                    <td height="30"><strong>修改密码</strong><%=msg%></td>
                  </tr>
                  <tr> 
                    <td width="17%" height="30"><div align="right">旧密码:</div></td>
                    <td width="83%"><input name="oldpwd" type="password" id="oldpwd" value="<%=rs("clubuser_password")%>"></td>
                  </tr>
                  <tr> 
                    <td height="30"><div align="right">新密码:</div></td>
                    <td><input name="newpwd1" type="password" id="newpwd1"></td>
                  </tr>
                  <tr> 
                    <td height="30"><div align="right">新密码确认:</div></td>
                    <td><input name="newpwd2" type="password" id="newpwd2"></td>
                  </tr>
                  <tr> 
                    <td height="30"><div align="right"></div></td>
                    <td><input type="submit" name="Submit" value="确认修改"></td>
                  </tr>
                </form>
              </table>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
    <!--#include file="tail.asp" -->
  </center>
</center>
</body>
</html>
<%closedb%>