<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
.STYLE5 {
	font-size: 13px;
	color: #A30C78;
	font-weight: bold;
}
-->
</style>
<script language="javascript">
<!--
function chkpass(){
 if(frmpass.oldpass.value.length==0){
  alert("请输入您的原始密码！");
  frmpass.oldpass.focus();
  return false;
 }
 if(frmpass.newpass.value.length==0){
  alert("请输入新密码！");
  frmpass.newpass.focus();
  return false;
 }
  if(frmpass.newpass.value.length<6){
  alert("密码长度不能小于6位！");
  frmpass.newpass.focus();
  return false;
 }
  if(frmpass.newpass1.value.length==0){
  alert("请输入重复输入新密码！");
  frmpass.newpass1.focus();
  return false;
 }
 if(frmpass.newpass.value!=frmpass.newpass1.value){
  alert("您两次输入的密码不一致！");
  frmpass.newpass.focus();
  return false;
 }
 return true;
}
//-->
</script>
</head>
<%
if request.QueryString("action")="save" then
  dim errmsg
  errmsg=""

if ChkPost=false then
  errmsg=errmsg+"<li>错误，不允许外部提交数据！"  
end if

dim oldpass,newpass,newpass1

oldpass=request.Form("oldpass")
newpass=request.Form("newpass")
newpass1=request.Form("newpass1")

if newpass<>newpass1 then 
  errmsg=errmsg+"<li>错误，两次输入的密码不一致！"
end if

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from user_info where userid="& userid &" and userpass='"& md5(oldpass) &"'"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
  errmsg=errmsg+"<li>原始密码输入错误！"
end if 
if errmsg<>"" then 
 response.Write "<div align='center'><br>错误信息：<br>"
 response.write("　　　"+ errmsg)
 response.Write "<br><br><input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'></div>"
 response.end
end if

rs("userpass")=md5(newpass)
rs.update
rs.close
set rs=nothing


set rst=server.CreateObject("adodb.recordset")   
sql1="select * from [user] where username='"& MemberName &"'"
rst.open sql1,conn,1,3
rst("password")=trpass(newpass)
rst.update
rst.close
set rst=nothing

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from [dv_user] where username='"& MemberName &"'"
rst.open sql1,conn,1,3
rst("userpassword")=md5(newpass)
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing

response.Write "<script language='javascript'>alert('您的密码已经修改完毕\n请用新密码重新登陆！');window.location='logout.asp'</script>"
response.end
end if
%>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="204" height="328" valign="top"><!--#include file="memberleft.asp"--></td>
    <td width="583" valign="top"><table width="565" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><TABLE width="100%" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" >
              <TBODY>
                <TR>
                  <TD align=center width="2%"><img src="image/tiao_3.gif" width="10" height="31"></TD>
                  <TD width="14%" align=center background="image/tiao_4.gif"><table width="86" height="25" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td align="center" class="pgd">修改密码</td>
                      </tr>
                  </table></TD>
                  <TD width="50%" height="20" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="32%" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="2%" align="center"><img src="image/tiao_2.gif" width="10" height="31"></TD>
                </TR>
              </TBODY>
          </TABLE></td>
        </tr>
        <tr>
          <td height="435" valign="top" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
            <br>
            <table width="531" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FEE2F5" bordercolordark="#FFFFFF" class="STYLE4">
              <tr>
                <td width="76%" height="80"><table width="490" border="0" cellpadding="3" cellspacing="2" bgcolor="#EEEEEE" class="STYLE4">
                    <form method="post" name="frmpass" action="modifypass.asp?action=save" onSubmit="return chkpass()">
                      <tr>
                        <td width="132" height="28"><div align="right">会员帐号：</div></td>
                        <td width="340"><input name="uname" type="text" disabled="disabled" id="uname" style="width:150px;height:22px" value="<%=MemberName%>"></td>
                      </tr>
                      <tr>
                        <td height="28"><div align="right">原密码：</div></td>
                        <td><input name="oldpass" type="password" id="oldpass" style="width:150px;height:22px" maxlength="20" onKeyDown="if(event.keyCode==32) return false"></td>
                      </tr>
                      <tr>
                        <td height="28"><div align="right">新密码：</div></td>
                        <td><input name="newpass" type="password" id="newpass" style="width:150px;height:22px" maxlength="20" onKeyDown="if(event.keyCode==32) return false"></td>
                      </tr>
                      <tr>
                        <td height="28"><div align="right">重复密码：</div></td>
                        <td><input name="newpass1" type="password" id="newpass1" style="width:150px;height:22px" maxlength="20" onKeyDown="if(event.keyCode==32) return false"></td>
                      </tr>
                      <tr>
                        <td height="28" colspan="2"><div align="center">
                            <input name="button1" type="submit" id="button1" value=" 更改 ">
                        </div></td>
                      </tr>
                    </form>
                </table></td>
              </tr>
              <tr>
                <td height="35">&nbsp;</td>
              </tr>
              <tr>
                <td height="10">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
    </table></td>
    <td width="163" valign="top"><!--#include file="fenlei.asp"-->
</td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
