最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
禁止垃圾注册的方法
时间:2008-03-22 编辑:简简单单 来源:一聚教程网
Public Function CheckNum(Str)
If Str="" Then Exit Function
If Session(Str)=False Then
RanDomize Timer
Session(Str)=Int(Rnd*9)+1
End If
CheckNum=Session(Str)
End Function
Function ValidInteger(str)
If Str="" then Exit Function
Dim re,chkstr
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="[^_\.0-9\d]"
ValidInteger=True
chkstr=re.Replace(Str,"")
ValidInteger=IsInteger(chkstr)
End Function
Public Function IsInteger(Para)
If Para="" then Exit Function
IsInteger=False
If Not (IsNull(Para) Or Trim(Para)="" Or Not IsNumeric(Para)) Then IsInteger=Para
'IsInteger=True
'End If
End Function
验证
inspect=ValidInteger(Request.Form("inspect"))
If inspect<>Trim(CheckNum("n1")+CheckNum("n2")) or (Isempty(CheckNum("n1")))then
Response.Write ""
response.End()
end if
Session("n1")=False:Session("n2")=False'消除验证码
显示页面
<%=CheckNum("n1")&"+"&CheckNum("n2")%>=
-
下一个: 禁止站外提交表单
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14