<%
str="lkdsoik" '这里为要过滤的字符
if ChkInvaildWord(str) then
response.write "你的输入含有非法字符"
else
response.write "你的输入的是合法字符"
end if
Function ChkInvaildWord(Words)
Const InvaildWords="select|update|delete|insert|@|--|http:|//|www|.com|.cn|.net" ''需要过滤得字符以“|”隔开,最后结束的字符必须是|
ChkInvaildWord=True
InvaildWord=Split(InvaildWords,"|")
inWords=LCase(Trim(Words))
For i=LBound(InvaildWord) To UBound(InvaildWord)
If Instr(inWords,InvaildWord(i))>0 Then
ChkInvaildWord=True
Exit Function
End If
Next
ChkInvaildWord=False
End Function
%>
上一篇:ASP指定字符截取字符串
下一篇:ASP判断只输出"英文"或"汉字"的两种方法
讨论数量:0