最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 简单防止外部提交
时间:2010-03-19 编辑:简简单单 来源:一聚教程网
'****************************************************
'函数名:ChkPost
'作 用:禁止站外提交表单
'返回值:true站内提交,flase站外提交
'****************************************************
Public Function ChkPost()
Dim url1,url2
chkpost=true
url1=Cstr(Request.ServerVariables("HTTP_REFERER"))
url2=Cstr(Request.ServerVariables("SERVER_NAME"))
If Mid(url1,8,Len(url2))<>url2 and instr(url1,"dl.loupan.com") = 0 Then
chkpost=false
exit function
End If
End function
'****************************************************
'函数名:GetUrl
'作 用:获取url包括参数
'返回值:获取url包括参数
'****************************************************
Public Function GetUrl()
Dim strTemp
strTemp=Request.ServerVariables("Script_Name")
If Trim(Request.QueryString)<> "" Then
strTemp=strTemp&"?"
For Each M_item In Request.QueryString
strTemp=strTemp&M_item&"="&Server.UrlEncode(Trim(Request.QueryString(""&M_item&"")))
next
end if
GetUrl=strTemp
End Function
'防止外部提交使用方法
call ChkPost()'
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14