办法一
if Instr(Request.ServerVariables("HTTP_REFERER"),")=0 And Instr(Request.ServerVariables("HTTP_REFERER"),")=0 then
response.write "警告非法来路访问被拒绝"
response.end
End IF
办法二
'过滤URL数组
Dim FilterURL(2),f
FilterURL(0)="
FilterURL(1)="
For f=0 To Ubound(FilterURL)
if FilterURL(i)<>"" And Instr(Request.ServerVariables("HTTP_REFERER"),FilterURL(i))=0 then
response.write "警告非法来路访问被拒绝"
response.end
End IF
Next
推荐办法二,办法二可以过滤很多非法URL地址
[
本帖最后由 yms123 于 2010-3-16 13:18 编辑 ]