<% If Request.Form("SecurityCode") = Session("SecurityCode") Then ' TODO : Database operations Else Response.Write "Security code incorrect!" End If %>
' str为要校验的验证码,len为验证码长度 Function IsSecurityCodeValid(str, len) IsSecurityCodeValid = Not CBool( _ IsEmpty(str) Or CStr(str)="" Or Len(str)<len) End Function If IsSecurityCodeValid(Request.Form("SecurityCode"), 4) AND _ IsSecurityCodeValid(Session("SecurityCode"), 4) AND _ Request.Form("SecurityCode") = Session("SecurityCode") Then ' TODO : Database operations Else Response.Write "Security code incorrect!" End If