function | member
Ways to prohibit garbage registration
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
Verify
Inspect=validinteger (Request.Form ("inspect"))
If Inspect<>trim (Checknum ("N1") +checknum ("N2")) or (IsEmpty ("Checknum")) N1
Response.Write "<script>alert (' you enter a registration validation error, use a half-angle input method to enter two number of and '); History.back ();</script>"
Response. End ()
End If
Session ("N1") =false:session ("N2") =false ' elimination Verification code
Show Page
<%=checknum ("N1") & "+" &checknum ("N2")%>= <input "name=" Inspect "text" type= "2" size= "2"/ >