注册 登录
编程论坛 ASP技术论坛

小弟新手,求大神帮忙看下这个问题

安其拉 发布于 2013-06-24 13:52, 711 次点击
<!--#include file="../conn.asp"-->
<!--#include file="login_admin.asp"-->
<%
dim rs
dim thesql
dim username
dim password
dim verifyid
verifyid=request.form("verifyid")

select case request("action")
case "login"
username=request.form("username")
password=request.form("password")
response.write username
if session("join_verifyid")<>verifyid or not isnumeric(verifyid) then
conn.close
set conn=nothing
response.write "<Script>window.alert('验证码错误!"&verifyid&"');history.go(-1);</Script>"
response.end
end if
if username=""  then
conn.close
set conn=nothing
response.write "<Script>window.alert('用户名不能空');history.go(-1);</Script>"
else
if password="" then
conn.close
set conn=nothing
response.write "<Script>window.alert('密码不能空');history.go(-1);</Script>"
else

set rs=server.createobject("adodb.recordset")
thesql = "select * from admin where username='"&username&"'"
rs.open thesql,conn,1,3
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<Script>window.alert('管理帐号错误!');javascript:history.back(1);</Script>"
response.end
else
if rs("password")<>password then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<Script>window.alert('管理密码错误!');javascript:history.back(1);</Script>"
response.end
else
session("admin1")=rs("username")
session("rank")=rs("rank")
response.redirect "mainmain.asp"
end if
end if
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing

case "loginout"
session("admin")=""
response.redirect "index.asp"
end select
%>
另外那个login_admin.asp页面里的代码为
<%
if session("admin1")="" then
response.write "<Script>window.alert('您目前还没有登录,请先登录!');location.replace('index.asp');</Script>"
end if
%>
但是用户名密码都对了也弹login_admin.asp页面设置的窗口,求高手解决问题出在哪儿?不胜感激。。在线等
3 回复
#2
kasonJC2013-06-24 16:03
有没跳转到mainmain.asp
#3
安其拉2013-06-24 16:12
回复 2楼 kasonJC
没有   就是提示  您目前还没有登录,请先登录!  
点确定就返回了
#4
y5640850462013-07-16 19:54
可能是缓存的问题,试下加条response的缓存语句
1