<!-- #include file="conn.asp" -->
<!-- #include file="inc.asp" -->
<%
call Check_Session("Agent")
oldpw=Trim(Request.Form("oldpw"))
password=Trim(Request.Form("password"))
sql="select * from agent where id="&session("Agent_ID")&" and Password='"&oldpw&"' "
set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,3
if rs.eof then
response.write"<SCRIPT language=JavaScript>alert('原密码错误!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else 
rs("password")=password
rs.update
response.write"<SCRIPT language=JavaScript>alert('修改密码成功!');"
response.write"this.location.href='index.asp';</SCRIPT>" 
response.end
end if
rs.close 
set rs=nothing 
conn.close
set conn=nothing 
%>
 