入库之前调用一下这个函数就可以了<br>
我这里有一个控件,上午刚装的系统,等我找到了再贴上来<br>
<br>
<br>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT> <br>
function DoWhiteSpace(str) <br>DoWhiteSpace = Replace((Replace(str, vbCrlf, "<br>")), chr(32)&chr(32), " ") <br>
End Function <br>
</SCRIPT><br>
<br>
<br>
不安全字符:<br>
Function urlencode(str)<br>If Trim(Str)="" Or IsNull(str) Then Exit Function<br>
str=Replace(str,"select","")<br>
str=Replace(str,"or","")<br>
str=Replace(str,"in","")<br>
str=Replace(str,"where","")<br>
str=Replace(str,"and","")<br>
str=Replace(str,";","")<br>
str=Replace(str,":","")<br>
str=Replace(str,"'","")<br>
str=Replace(str,".","")<br>
str=Replace(str,"@","")<br>
str=Replace(str,"$","")<br>
str=Replace(str,"%","")<br>
str=Replace(str,"&","")<br>
str=Replace(str,"(","")<br>
str=Replace(str,")","")<br>
str=Replace(str,"*","")<br>
str=Replace(str,"=","")<br>
str=Replace(str,"+","")<br>urlencode=str<br>
End Function<br>
<br>
html过滤:<br>
Function HtmlEncode(str)<br>If Trim(Str)="" Or IsNull(str) Then Exit Function<br>str=Replace(str,">",">")<br>str=Replace(str,"<","<")<br>str=Replace(str,Chr(32)," ")<br>str=Replace(str,Chr(9)," ")<br>str=Replace(str,Chr(34),""")<br>str=Replace(str,Chr(39),"'")<br>str=Replace(str,Chr(13),"")<br>str=Replace(str,Chr(10) & Chr(10), "</p><p>")<br>str=Replace(str,Chr(10),"<br> ")<br>HtmlEncode=str<br>
End Function<br>
<br>
|