[點晴永久免費OA]asp實現(xiàn)防止站外提交內(nèi)容的兩個方法
方式一:
代碼如下: <%
Function IsSelfRefer() Dim formUrl,relUrl formUrl=LCase(Trim(request.ServerVariables("HTTP_REFERER"))) If formUrl="" Then IsSelfRefer = False Else relUrl="http://" & Trim(Request.ServerVariables("SERVER_NAME")) If (formUrl<>relUrl) Then IsSelfRefer = False Else IsSelfRefer = True End If End If End Function %> 方式二: 代碼如下: <%
Function IsSelfRefer() Dim sHttp_Referer, sServer_Name sHttp_Referer = CStr(Request.ServerVariables("HTTP_REFERER")) sServer_Name = CStr(Request.ServerVariables("SERVER_NAME")) If Mid(sHttp_Referer, 8, Len(sServer_Name)) = sServer_Name Then IsSelfRefer = True Else IsSelfRefer = False End If End Function %> 該文章在 2022/7/4 11:29:22 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |