<!-- #include file="conn.asp" -->
<!-- #include file="inc.asp" -->
<%
call Check_Session("Tch")
oldpw=request.form("oldpw")
password=request.form("password")
sql="select * from teacher where id="&makeid("tch","in",session("Tch_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 
%>
 