大哥大姐 帮我看看错在哪里 重分赏

cpeboy cpeboy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位大哥:我写了一个asp密码验证代码 帮我看一看下面的两个asp页面之间有什么逻辑错误,我实在是头都想炸了也检查不出来,当登陆用户和密码错误的时候跳转到了login.asp页面,可是当登陆用户和密码正确的时候无法登陆到loginok.asp页面 ,还是跳转到login.asp页面

login.asp页面如下:
<!--#include file="top.asp"-->
<br>
<br>
<div align="center">
<% if isempty(session("user"))then %>
<font size="2" ><strong>用 户 登 陆</strong></font>
<% elseif session("user")="false" then %>
<font size="2" color="#FF0000"><strong>您非法登陆或者输入错误!</strong></font>
<% elseif session("user")="true" then
response.redirect("loginok.asp")
response.end
end if%>
</div>

<br>
<br>

<form name="form" action="checklogin.asp">
<div align="center"><font size="2">请输入用户名:
<input type="text" name="admin" size="8">
<br><br>
请输入密 码:
<input type="password" name="password" size="8">
<br><br>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</font></div>
</form>
<br><br><br><br>
<!--#include file="bottom.asp"-->

checklogin.asp页面如下:

<!--#include file="conn.asp"-->
<%

dim rs5,sql5
set rs5=server.CreateObject("adodb.recordset")
sql5="select admin,password from admin where id=1"
rs5.open sql5,conn,1,1
dim admin ,password
admin=trim(request.Form("admin"))
password=trim(request.Form("password"))
if admin=rs5("admin") and password=rs5("password")then
session("user")="true"
response.redirect("loginok.asp")
else
session("user")="false"
response.Redirect("login.asp")
end if
rs5.close
set rs5=nothing

%>
...全文
评论 13
收藏 已收藏
分享
返回顶部
cpeboy
ASP 28,401 成员 356,940 内容