后台登陆验证
<%dim username
dim password
username=request.form("myuser")
password=request.form("mypassword")
set rs=server.createobject("adodb.recordset")
sql="select * from users where u_user='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
else
if rs("u_password")<>"password" then
response.write "<script>alert('登录失败');history.back();</script>"
response.end
end if
session("admin")="username"
response.write"<script>alert('登录成功');location.href='index.asp'</script>"
end if
%>
请问以上的代码哪里出错了吗? 为什么每次运行的时候都是弹出"登录失败" .知道的高手请指点我一下,谢谢了.