【www.gdgbn.com--php函数】

  "函数名:ChkPost
  "作  用:禁止站外提交表单
  "返回值:true站内提交,flase站外提交
    "参数:链接串
  function ChkPost()
  dim server_v1,server_v2
  chkpost=false
  server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
  server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
  If Mid(server_v1,8,Len(server_v2))<>server_v2 then
   chkpost=False
  else
   chkpost=True
  end If
 end Function

"使用方法
 If Not ChkPost() Then
  showErrorImg = true
 End If
 

本文来源:http://www.gdgbn.com/jiaocheng/24073/