<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<%
  Response.Buffer = true
  Response.ExpiresAbsolute=now()-1
  Response.Expires=0
  Response.CacheControl="no-cache"
%>
<%
if Not ChkPost then 
response.redirect ("../../login/chklogin.asp?login=4")
response.end
end if

if session("id")="" then
response.Redirect("../../login/login1.asp")
response.end
end if

id=session("id")

oldpass=Replace_Text(request.form("oldpass"))
pass=Replace_Text(request.form("pass"))
question=Replace_Text(request.form("question"))
answer=Replace_Text(request.form("answer"))

%>
<%
sql="select id from corporation where id="&id&" and pass='"&oldpass&"'" 
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof then
response.write"<SCRIPT language=JavaScript>alert('您填写的旧密码不正确，请返回重新填写！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end 
end if

set rs=server.CreateObject ("adodb.recordset")
sql="select * from corporation where id="&id&""
rs.open sql,conn,1,3
rs("pass")=pass
rs("question")=question
rs("answer")=answer
rs.update
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>操作成功</title>
<link href="../../images/css.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='1;url=modify_pass.asp'>
</head>

<table border="0" cellspacing="0" width="100%" cellpadding="0" height="418" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="418" valign="middle" align="center">
<b>恭喜您，您的密码已经修改成功！<a href="modify_pass.asp">返回</a></b></td>
</tr>
</table>
</body>
</html>
<%
rs.close
set rs=noting
conn.close
set conn=nothing
%>