if Request ("email") = "" or Instr(email," ") > 0 or InStr(email, "@") < 2 then
bError = true
else
'go to success page
'BUT ABOUT OTHER ISSUES?
end if
---------------該處是非REGEXP基於電子郵件檢查,不能肯定是否ITS FOOL PROOF但比提交片斷應該讓你去...
Function IsEmail(sCheckEmail)
Dim SEmail, NAtLoc
IsEmail = True
SEmail = Trim(sCheckEmail)
NAtLoc = InStr(SEmail, "@")
If Not (nAtLoc > 1 And (InStrRev(sEmail, ".") > NAtLoc + 1)) Then
IsEmail = False
ElseIf InStr(nAtLoc + 1, SEmail, "@") > NAtLoc Then
IsEmail = False
ElseIf Mid(sEmail, NAtLoc + 1, 1) = "." Then
IsEmail = False
ElseIf InStr(1, Right(sEmail, 2), ".") > 0 Then
IsEmail = False
End If
End Function
您首先需要爲請求值分配一個名爲「email」的變量:'email = Request(「email」)'。 – 2012-02-15 07:28:30