正 文

ASP的两个简单的检测外部提交函数


www.7dspace.com  更新日期:2005-8-17 4:15:48  七度空间


 

  本文例举了ASP的两个简单的检测外部提交函数的例子,第一个函数是ChkPost(),它可以检测用户当前所在服务器名是否存在于来源页面,第二个函数是PostCheck(),它可以通过很简单的检测,看看提交是否为POST方式。

    函数ChkPost()

  检测用户当前所在服务器名是否存在于来源页面

  代码如下: 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 


  函数PostCheck()

  很简单的检测,就是检测提交是否为POST方式

  代码如下: Function PostCheck()


   PostCheck=False
  If Lcase(Request.ServerVariables("Request_Method"))="post" Then PostCheck=True
  End Function 


上一篇:ASP获取客户端MAC地址(源代码)
下一篇:ASP记录点击数的实现
作者:  来源:七度空间 ( 责任编辑:7dspace )
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐