asp判断出错

来源:百度知道 编辑:UC知道 时间:2024/07/07 17:50:20
if rs("hy_xingming")=hy_xingming and rs("hy_mima")=hy_mima then
session("hy_xingming")=hy_xingming
response.Redirect("../index.asp")
else
response.Redirect("../error/err.asp?id=12")
end if
不管对与错..为什么老跳到else 语句
' else
' response.Redirect("../error/err.asp?id=12")
我屏蔽这二句就好了!为什么这样?????/

要先查询到这个姓名的一条记录再来查密码是否正确
可以这样,
sql="select * from 表名 where hy_xingming='"&hy_xingming&"'"
rs.open sql,conn,1,1
if not rs.eof then
if rs("hy_mima")=hy_mima then
session("hy_xingming")=hy_xingming
response.Redirect("../index.asp")
else
response.Redirect("../error/err.asp?id=12")
end if
else
response.Redirect("../error/err.asp?id=12")
end if
rs.close

if rs("hy_xingming")=hy_xingming and rs("hy_mima")=hy_mima then
response.write "a"
else
response.write "b"
end if

找找if rs("hy_xingming")=hy_xingming and rs("hy_mima")=hy_mima then
的问题

if rs("hy_xingming")=hy_xingming and rs("hy_mima")=hy_mima then
session("hy_xingming")=hy_xingming
改为:
if rs("hy_xingming")="hy_xingming&q