<!--#include file="mdb.asp"-->
<!--#include file="config.asp"-->
<!--#include file="md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>收藏夹</title>
<style type="text/css">
<!--
a {
	font-size: 12px;
	color: #6A6A6A;
}
a:visited {
	color: #4F4F4F;
	text-decoration: none;
}
a:active {
	color: #F97C00;
	text-decoration: none;
}
a:link {
	color: #4F4F4F;
	text-decoration: none;
}
a:hover {
	text-decoration: none;
	color: #F97C00;
}
body,td,th {
	font-size: 12px;
	color: #4F4F4F;
}
.greenborder {border:1px solid #7EC8EA;}
.greenborder1 {border-right:1px solid #7EC8EA; background-color:#EFF8FC}
.inp {width:154px;border:1px solid #7f9db9;color:#052A5C}
.inp1 {width:66px;border:1px solid #7f9db9;color:#052A5C;font-size:9px;height:15px;margin-right:2px}
.slct {width:158px}
.sub {width:36px}
body {
	margin-top: 0px;
}
.style1 {font-weight: bold}
-->
</style>
<script>
function check()
{
    var form = document.upForm;
	if (form.pw.value =="")
	{
		alert("请先输入旧密码!");
		form.pw.focus();
		return false;
	}
	if (form.pw1.value =="")
	{
		alert("请先输入新密码!");
		form.pw1.focus();
		return false;
	}
	if (form.pw2.value =="")
	{
		alert("请先输入密码确认!");
		form.pw2.focus();
		return false;
	}
	if (form.pw1.value.length > 12 || form.pw1.value.length < 3)
	{
		alert("密码为(3-12)字之间!");
		form.pw1.focus();
		return false;
	}
	if(form.pw1.value != form.pw2.value)
	{
		alert("两次密码输入不一致,请检查!");
		form.pw2.value = "";
		form.pw2.focus();
		return false;
	}
	return true;
}
</script>
</head>
<body>
<%
select case Request("menu")
case ""
main()
case "uppw"
uppw()
end select
sub main()
if username="test" then
   Response.Write("<br><br><div align=center>体验用户不能修改密码！<a href='reg.htm' target='_parent'><font color='#FF0000'>→点此马上注册自已的网址收藏夹</font></a></div>")
   Response.end
else
%>
<form action="?" method="post" name="upForm" id="upForm" onSubmit="return check();">
  <table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#62B0FF">
    <tr>
      <td width="7%" bgcolor="#BFDFFF">旧密码：</td>
      <td width="93%" bgcolor="#FFFFFF"><input name="pw" type="password" id="pw">
        3-12个字符 &nbsp;&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#BFDFFF">新密码：</td>
      <td bgcolor="#FFFFFF"><input name="pw1" type="password" id="pw1">
	  　3-12个字符 &nbsp;&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#BFDFFF">确&nbsp;&nbsp;认：</td>
      <td bgcolor="#FFFFFF"><input name="pw2" type="password" id="pw2">
	    3-12个字符 &nbsp;&nbsp;
      </td>
    </tr>
      <td bgcolor="#BFDFFF">操&nbsp;&nbsp;作：</td>
      <td bgcolor="#FFFFFF"><input type="hidden" name="menu" value="uppw"><input type="submit" name="Submit2" value="提交">
          <input type="reset" name="Submit3" value="取消">
      </td>
    </tr>
  </table>
</form>
<%
end if
end sub
sub uppw()
dim pw,pw1
pw=md5(trim(request("pw")),16)
pw1=md5(trim(request("pw1")),16)
set rs=server.createobject("adodb.recordset")
rs.open"select * from lg50_my_user where username='"&username&"' and password='"&pw&"'",conn,1,3
if rs.eof and rs.bof then
	rs.close
	set rs=nothing
	Response.Write("<script language=javascript>alert('请输入正确旧密码');this.location.href='pw.asp';</script>")
	Response.End
else
    rs("password")=pw1
	rs.Update
	rs.close
	set rs=nothing
	Response.Write("<script language=javascript>alert('密码修改成功');this.location.href='main.asp';</script>")
end if
end sub
%>
</body>
</html>

