ASP多用户登陆

<!-- #include file="conn/conn.asp" --><% ✀读取数据库exec="select * from login" set rb=server.createobject("adodb.recordset") rb.open exec,conn,1,1 %> <% usename=request.form("usename") usepass=request.form("usepass") if usename=""then response.write"<script>alert(✀登录失败,用户名为空✀);location.href=✀login.asp✀</script>"Response.end end if if usepass="" then response.write"<script>alert(✀登录失败,密码为空✀);location.href=✀login.asp✀</script>"Response.end end if if usename=rb("usename") and usepass=rb("usepass") thenresponse.write"<script>alert(✀恭喜,登录成功✀);location.href=✀tongxin.asp✀</script>"elseresponse.write"<script>alert(✀登录失败,帐号或密码不正确✀);location.href=✀login.asp✀</script>"Response.end end if Session("usename")=usename %>怎么只有一个用户可以登陆的,,在数据库中的第一条就可以,,其它就不行了,,为什么,怎样改呢
2026年09月24日 22:09
有1个网友回答
网友(1):


<%
usename=request.form("usename")
usepass=request.form("usepass")
if usename=""then
response.write""
Response.end
end if
if usepass="" then
response.write""
Response.end
end if
'读取数据库
exec="select * from login where usename='"&usename&"' and usepass='"&usepass&"'"
set rb=server.createobject("adodb.recordset")
rb.open exec,conn,1,1
if not (rs.eof and rs.bof) then
Session("usename")=usename
response.write""
else
response.write""
Response.end
end if
rb.close
%>