|
最好的防站外提交的方法
'====================防站外提交
'====================文件名为href.asp
ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER")))
if ComeUrl="" then
response.write "
对不起,为了系统安全,不允许直接输入地址访问本系统的后台管理页面。 "
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 "
对不起,为了系统安全,不允许从外部链接地址访问本系统的后台管理页面。 "
response.end
end if
end if
'===============调用方法
'===============在你要检测的页面顶部加
'===============呵呵,如果你不想所有人访问你的网站,你可以在首面加入这个
'===============这样就没人能访问你的网站了.
|