asp登录验证问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 00:33:06
提示总是密码不正确,但我用
'response.Write(xingming)
'response.Write(rs("xingming"))
'Response.write(mima)
'Response.write(rs("mima"))
显示密码是相等的呀!!!

程序如下,请达人赐教啊
<!--#include file="connection.asp"-->

<%
dim xingming,mima
xingming=request("xingming")
mima=request("mima")
if xingming="" then
%>
<script language=javascript>
alert("帐号为空");
location.href="denglu.asp"
</script>
<% end if %>
<% if mima="" then
%>
<script language=javascript>
alert("密码为空");
location.href="denglu.asp"
</script>
<% end if %>

<%
exec="select * from users where xingming='"&xingming&"'"
set rs=server.createobject("adodb.recordset")
rs

晕`密码用整型..
这样的话你要转换一下...

if mima=cint(rs("mima")) then

if trim(mima)=trim(rs("mima")) then

if trim(mima)=trim(rs("mima")) then '这样看看

if not rs.eof then
if trim(mima)=trim(rs("mima")) then
'session("xingming")=xingming
response.write ("<script>location.href('index.asp')</script>")
'response.Write(xingming)
'response.Write(rs("xingming"))
'Response.write(mima)
'Response.write(rs("mima"))
else
response.write ("<script>alert('用户密码错误');location.href('denglu.asp')</script>")
end if
else
response.write ("<script>alert('用户帐号错误');location.href('denglu.asp')</script>")
end if
rs.close
set rs=nothing

exec="select * from users where xingming='"&xingming&"