修改密码的程序的逻辑错误,请教各位达人,哪里错了
elian 2005-05-07 03:23:55 <%
username=Request("username")
oldpass=Request("oldpass")
newpass=Request("newpass")
checkpass=Request("checkpass")
%>
<%if MD5(oldpass)<> session("password") then%>
<script language=javascript>
alert( "错误:原密码错误!" );
location.href = "javascript:history.back()"
</script>
<%end if
if newpass="" or checkpass="" then%>
<script language=javascript>
alert( "错误:请输入新密码!" );
location.href = "javascript:history.back()"
</script>
<%end if
if newpass <> checkpass then%>
<script language=javascript>
alert("两次新密码不一致!!!")
location.href = "javascript:history.back()"
</script>
<%
end if
'开始修改用户密码
set AdoRs=Server.CreateObject("AdoDB.RecordSet")
lcsql="select * from yh_k where yh_zh='"+username+"'"
AdoRS.Open lcSql,conn,2,3
if not adors.eof then
adors("yh_mm")=MD5(newpass)
adors.update()
Session("password")=MD5(newpass)
end if
set adors=Nothing
%>