【2个简单吗】2个简单的检测外部提交函数

更新时间:2014-07-12    来源:php函数    手机版     字体:

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

函数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

本文来源:http://www.bbyears.com/jiaocheng/7741.html

猜你感兴趣