谢谢~~~
你可以专门做一个页面(function.asp)
然后在要过滤字符的页面包含进来
<!--#include file="function.asp" -->
function.asp 页面代码如下(eg):
[QUOTE]<%
Function CheckStr(byVal ChkStr) '字符过滤
Dim Str:Str=ChkStr
Str=Trim(Str)
If IsNull(Str) Then
CheckStr = ""
Exit Function
End If
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(\r\n){3,}"
Str=re.Replace(Str,"$1$1$1")
Set re=Nothing
Str = Replace(Str,"'","''")
Str = Replace(Str, "select", "select")
Str = Replace(Str, "join", "join")
Str = Replace(Str, "union", "union")
Str = Replace(Str, "where", "where")
Str = Replace(Str, "insert", "insert")
Str = Replace(Str, "delete", "delete")
Str = Replace(Str, "update", "update")
Str = Replace(Str, "like", "like")
Str = Replace(Str, "drop", "drop")
Str = Replace(Str, "create", "create")
Str = Replace(Str, "modify", "modify")
Str = Replace(Str, "rename", "rename")
Str = Replace(Str, "alter", "alter")
Str = Replace(Str, "cast", "cast")
Str = Replace(Str, "script", "script")
Str = Replace(Str, "src", "src")
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
CheckStr=Str
End Function
%>[/QUOTE]