asp代码解除判断是否直接输入地址访问本系统的后台管理页面的限制

来源:百度知道 编辑:UC知道 时间:2024/05/16 02:42:49
下面是一段代码他限制了你直接输入后台地址登入!
要怎么改才能解除限制!
我是在IIS上测试的时候,无论我怎么输入!他都会提示对不起,为了系统安全,不允许直接输入地址访问本系统的后台管理页

面。
但是我的服务器上测试就不会!

' ============================================
' 判断是否直接输入地址访问本系统的后台管理页面
' ============================================
sub ComeUrl
dim ComeUrl,cUrl
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,"/

sub ComeUrl
dim ComeUrl,cUrl
ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER")))

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 sub

你把这段判断URL来源的程序去掉不就可以了么?