<%
'脏字过滤
Function CkBadWords(fString)
    IF not(isnull(BadWords) or isnull(fString)) then
    BadWords = split(BadWords, "|")
	dim i
    For i = 0 to ubound(BadWords)
        fString = Replace(fString, BadWords(i), string(len(BadWords(i)),"*")) 
    Next
    CkBadWords = fString
    End IF
End Function
'检查年龄
Function CkAge(LngAge)
IF LngAge="" Then Error("您忘了填写年龄")
Dim RE
Set RE = New RegExp
RE.Pattern = "[0-9]{"&Len(LngAge)&"}"
RE.IgnoreCase = False
RE.Global = False
CkAge = RE.Test(LngAge)
Set RE = Nothing
IF CkAge = True Then
IF LngAge < 2 Then Error("您的年龄太小了<br>PS：孩子 您这么小就能上网啊 真厉害! 将来肯定比我强! 来哥哥(SLIGHTBOY)赏你个棒棒糖 ^*^")
IF LngAge > 100 Then Error("您的年龄太大了<br>PS：不会吧？ 老爷爷 精力充沛啊 还上网啊 活这么久能告诉我方法吗？ 我帮你宣传宣传 ^*^")
Else
Error("年龄栏只能输入数字")
End IF
End Function
'邮件检查
Function chkemail(strEmailAddr)
    chkemail=False
    Dim RE
    Set RE = new RegExp
    RE.pattern = "^[a-zA-Z][A-Za-z0-9_.-]+@[a-zA-Z0-9_]+?\.[a-zA-Z]{2,3}$"
    chkemail=RE.Test(strEmailAddr)
    Set RE=Nothing
End Function
'HTML 编码 (不支持)
Function HTMLEncode(fString)
IF not isnull(fString) then
    fString = Replace(fString, ">", "&gt;")
    fString = Replace(fString, "<", "&lt;")
    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
    fString = Replace(fString, CHR(10), "<BR> ")
    HTMLEncode = fString
End IF
End Function
'HTML 支持
Function HTMLcode(fString)
IF not isnull(fString) then
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
    fString = Replace(fString, CHR(10), "<BR>")
    HTMLcode = fString
End IF
End Function
%>