ホームページ  >  記事  >  ウェブフロントエンド  >  メール[非正規]_フォーム効果の合法性を判定する機能

メール[非正規]_フォーム効果の合法性を判定する機能

WBOY
WBOYオリジナル
2016-05-16 18:57:49888ブラウズ

<%
Function IsValidEmail(email)
Dim names, Name, i, c
IsValidEmail = True
names = Split(email, "@")
If UBound(名前)<> 1 then
IsValidEmail = False
関数を終了
End If
名前の各名前について
If Len(Name) <= 0 then
IsValidEmail = False
関数を終了
End If
For i = 1 To Len(Name)
c = LCase(Mid(Name, i, 1))
If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) then
IsValidEmail = False
関数終了
End If
Next
If Left(Name, 1) = "."または Right(Name, 1) = "." then
IsValidEmail = False
関数終了
End If
Next
If InStr(names(1), ".") <= 0 then
IsValidEmail = False
終了関数
End If
i = Len(names(1)) - InStrRev(names(1), ".")
If i <> 2 そして私は<> 3 次に
IsValidEmail = False
関数終了
End If
If InStr(email, "..") > 0 then
IsValidEmail = False
End If
End Function
%>

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。