后台登录文件admin_denglu.asp中部分代码如下:
(其它访问都正常,就后台管理员登录后只显示空白页,网址停留在admin_denglu.asp页面且源代码变为空,不会跳转到admin_main.asp页面。不知道是服务器上IIS配置、磁盘权限还是哪里的问题,请高手不吝赐教!谢谢!)
"
end if
…… //此处省略了验证密码验证码为空的提示信息
if FoundErr=True then
exit sub
end if
If UserTrueIP = "" Then
TrueIP = Trim(Request.ServerVariables("HTTP_X_FORWARDED_FOR"))
If TrueIP = "" Then TrueIP = Request.ServerVariables("REMOTE_ADDR")
Else
TrueIP = UserTrueIP
End If
password=md5(password,16)
set rs=server.createobject("adodb.recordset")
sql="select * from "&AdminTable&" where password='"&password&"' and username='"&username&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "用户名或密码错误!!!"
else
if passwordrs("password") then
FoundErr=True
ErrMsg=ErrMsg & "用户名或密码错误!!!"
end if
end if
if FoundErr=True then
session("AdminName")=""
session("AdminPassword")=""
session("RndPassword")=""
rs.close
set rs=nothing
exit sub
end if
RndPassword=GetRndPassword(16)
rs("LastLoginIP")=TrueIP
rs("LastLoginTime")=now()
rs("LoginTimes")=rs("LoginTimes")+1
rs("RndPassword")=RndPassword
rs.update
Response.Cookies(webkey)("AdminName") = rs("username")
Response.Cookies(webkey)("AdminPassword") = rs("Password")
Response.Cookies(webkey)("RndPassword") = RndPassword
rs.close
set rs=nothing
call CloseConn()
Response.Redirect "Admin_main.asp"
end sub
sub Logout()
set rs=server.createobject("adodb.recordset")
sql="select * from "&AdminTable&" where username='"&ReplaceBadChar(Trim(Request.Cookies(webkey)("AdminName")))&"'"
rs.open sql,conn,1,3
rs("LastLogoutTime")=now()
rs.update
rs.close
set rs=nothing
Response.Cookies(webkey)("AdminName") = ""
Response.Cookies(webkey)("AdminPassword") = ""
Response.Cookies(webkey)("RndPassword") = ""
call CloseConn()
Response.Redirect "admin_denglu.asp"
end sub
|