asp 禁止外部提交

[浏览181]
<%
Call CheckPageFrom
Function CheckPageFrom()
Dim host, referer
host = Request.ServerVariables("HTTP_HOST")  '网站域名
referer = Request.ServerVariables("HTTP_REFERER")  '前一页面URL地址
If Cstr(Left(Replace(referer, "http://", ""), Len(host))) <> Cstr(host) Then
  response.Write "<script language='javascript'>alert('Sorry!What do you want to do?'); location = 'index.html';</script>"
  response.End()
End IF
End Function
pas=Request.QueryString("pa")
ssa=Request.QueryString("ss")

If pas="" then
Response.Write"<script language='javascript'>alert('参数错误!');history.back();</script>"
Response.End()
end if
%>

关闭 ]
友情链接

Copyright © 2014 ASP技巧教程源码大全 All Rights Reserved
晋ICP备14006235号-3 页面执行时间:109.375毫秒 返回顶部