<!--#include file=CONN.ASP-->
<!--#include file=foxx.asp-->
<!--#include file="config.asp"-->
<!--#include file=md5.asp-->
<!--#include file="usercookies.asp"-->

<link href="fox.css" rel="stylesheet" type="text/css">
<%
dim rs,sql
dim pass1,pass2,pass3,pass_1,pass_2,username
pass1=trim(request("pass1"))
pass2=trim(request("pass2"))
pass3=trim(request("pass3"))
username=trim(request("username"))
if pass1="" or pass2="" or pass3="" then
response.Write "<script LANGUAGE='javascript'>alert('填写不完整！');history.go(-1);</script>"
response.end
end if
if pass2<>pass3 then
response.Write "<script LANGUAGE='javascript'>alert('两次填写密码不同！');history.go(-1);</script>"
response.end
end if
pass_1=md5(pass1)
pass_2=md5(pass2)
username=request.cookies("fox")("username")
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select password,jf from [FOX_user] where username='"&username&"' and password='"&pass_1&"'"
rs.open sql,conn,1,3
if rs.eof then
response.Write "<script LANGUAGE='javascript'>alert('原密码错误！');history.go(-1);</script>"
else
rs("password")=pass_2
rs("jf")=rs("jf")-zlhjf
rs.update
response.Write "<script LANGUAGE='javascript'>alert('您已经修改了您的密码，请重新登陆！');this.location.href='login.asp';</script>"
	Response.Write"<meta http-equiv='refresh' content='180;URL=login.asp'>"
                    rs.close
                    set rs=nothing
                    Response.cookies("fox")=""
end if

%>	
</body></html>