小弟新手,求大神帮忙看下这个问题
<!--#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页面设置的窗口,求高手解决问题出在哪儿?不胜感激。。在线等