asp 过滤非法字符函数asp
<%
Function cutbadchar(str)
badstr="反|对|不|文|明|行|为"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(s...
<%
Function cutbadchar(str)
badstr="反|对|不|文|明|行|为"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(str,badword(i),"***")
End If
Next
cutbadchar=str
End Function
Response.Write cutbadchar("反对")
%>
Function cutbadchar(str)
badstr="反|对|不|文|明|行|为"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(str,badword(i),"***")
End If
Next
cutbadchar=str
End Function
Response.Write cutbadchar("反对")
%>
下一篇:asp防止SQL注入
我要评论