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

求助!!!这个是asp网站的代码,我在本登陆时候进入后台总是提示“对不起,为了系统安全,不允许从外部链接地址访问本系统的后台管理页面”请问怎么解决这个问题

zhuoqunnet 发布于 2013-10-12 17:11, 604 次点击
程序代码:
<%
dim ComeUrl,cUrl,AdminName

ComeUrl
=lcase(trim(request.ServerVariables("HTTP_REFERER")))
if ComeUrl="" then
    response.write
"<br><p align=center><font color='red'>对不起,为了系统安全,不允许直接输入地址访问本系统的后台管理页面。</font></p>"
    response.end
else
    cUrl
=trim("http://" & Request.ServerVariables("SERVER_NAME"))
   
if mid(ComeUrl,len(cUrl)+1,1)=":" then
        cUrl
=cUrl & ":" & Request.ServerVariables("SERVER_PORT")
   
end if
    cUrl
=lcase(cUrl & request.ServerVariables("SCRIPT_NAME"))
   
if lcase(left(ComeUrl,instrrev(ComeUrl,"/")))<>lcase(left(cUrl,instrrev(cUrl,"/"))) then
        response.write
"<br><p align=center><font color='red'>对不起,为了系统安全,不允许从外部链接地址访问本系统的后台管理页面。</font></p>"
        response.end
   
end if
end if

AdminName
=replace(session("AdminName"),"'","")
if AdminName="" then
   
call CloseConn()
    response.redirect
"login.asp"
    response.End()
end if
sql
="select UserName from Admin where UserName='" & session("AdminName") & "' and Password='" & session("AdminPassword") & "'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
  rs.close
  response.Redirect(
"login.asp")
  response.End()
end if
%>
求助!!!这个是asp网站的代码,我在本登陆时候进入后台总是提示“对不起,为了系统安全,不允许从外部链接地址访问本系统的后台管理页面”请问怎么解决这个问题
1 回复
#2
hu9jj2013-10-13 07:23
将两处的提示内容修改成不一样,这样就可以分辨出是执行哪行代码了,也就可以进一步分析了。
1