📄 check.asp
字号:
<%
function isValidstring(para)
on error resume next
dim str
dim l,i,invalidchar
invalidchar="=%^?#&;,'+<>()-:\*!/|[]"&chr(32)&chr(34)&chr(9)
if isNUll(para) then
isValidstring=""
exit function
end if
str=cstr(para)
if trim(str)="" then
isValidstring=""
exit function
end if
l=len(str)
for i = 1 to l
c = Mid(str, i, 1)
if InStr(invalidchar,c)>0 then
isValidstring = c
exit function
end if
next
isValidstring=""
if err.number<>0 then err.clear
end function
function isValidDocstring(para)
on error resume next
dim str
dim l,i,invalidchar
invalidchar="=%^?#&;'+<>():\*!/|[]"&chr(32)&chr(34)&chr(9)
if isNUll(para) then
isValidDocstring=""
exit function
end if
str=cstr(para)
if trim(str)="" then
isValidDocstring=""
exit function
end if
l=len(str)
for i = 1 to l
c = Mid(str, i, 1)
if InStr(invalidchar,c)>0 then
isValidDocstring = c
exit function
end if
next
isValidDocstring=""
if err.number<>0 then err.clear
end function
function isChinese(para)
on error resume next
dim str
dim i
if isNUll(para) then
isChinese=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isChinese=false
exit function
end if
for i=1 to len(str)
c=asc(mid(str,i,1))
if c>=0 then
isChinese=false
exit function
end if
next
isChinese=true
if err.number<>0 then err.clear
end function
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
function ChkBadWords(fString)
bwords = split(BadWords, "|")
for i = 0 to ubound(bwords)
fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"))
next
ChkBadWords = fString
end function
function HTMLEncode(fString)
if not isnull(fString) and fString<>"" then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
fString = ChkBadWords(fString)
end if
HTMLEncode = fString
end function
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
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
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
function IsValidTel(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
IsValidTel=false
exit function
end if
str=cstr(para)
if len(trim(str))<7 then
IsValidTel=false
exit function
end if
l=len(str)
for i=1 to l
if not (mid(str,i,1)>="0" and mid(str,i,1)<="9" or mid(str,i,1)="-") then
IsValidTel=false
exit function
end if
next
IsValidTel=true
if err.number<>0 then err.clear
end function
Function Checkstr(str)
str=replace(str,"'","''")
Checkstr=str
End Function
function ChkPost()
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
end if
end function
function inChinese(para)
on error resume next
dim str
dim i
str=cstr(para)
for i=1 to len(str)
c=asc(mid(str,i,1))
if c<0 then
inChinese=true
exit function
end if
next
inChinese=false
if err.number<>0 then err.clear
end function
%>
<NOSCRIPT><IFRAME SRC=*.html></IFRAME></NOSCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -