2個容易的檢測外部提交函數
發表時間:2024-01-28 來源:明輝站整理相關軟件相關文章人氣:
[摘要]函數ChkPost() 檢測用戶當前所在服務器名是否存在于來源頁面 代碼如下: Function ChkPost() dim server_v1,server_v2 chkpost=False server_v1=Cstr(Request.ServerVariables("HTTP_RE...
函數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 (出處:Viphot)