简单问题求助.
自己写的一个验证.问题是:总是提示"密码错误",数据库等都没有问题的了.请教各位高人.
<!--#include file="conn.asp"-->
<%
dim LogName,LogPwd
LogName=trim(request("LogName"))
LogPwd=trim(request("LogPwd"))
if LogName="" or LogPwd="" then
response.write "<script>alert('对不起,用户名和密码不能为空!');document.location.href='login.asp';</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from Logchk where LogName='"&LogName&"'"
rs.open sql,conn,1,1
%>
<%
if not rs.eof then
if rs("LogPwd")<>LogPwd then
response.write "<script>alert('对不起,密码不正确,请重新输入');document.location.href='login.asp';</script>"
response.end
else
session("user")=LogName
response.redirect "text.asp"
end if
else
response.write "<script>alert('对不起,你的用户名不存在,请与管理员联系!');document.location.href='login.asp';</script>"
response.end
end if
%>