[求助]如何替换掉非法字符,我在论坛上没有搜索到就来请教了
高手可以举例吗
还有就是替换非法字符的代码一般是放在处理信息的文件里还是放在输出信息的文件里呢
新手上路问题多多

我不喜欢这样,因为这样没有真实感,而且不方便别人复杂代码。
[此贴子已经被作者于2006-1-22 22:27:49编辑过]

function checkStr(str)
    str=replace(str,"'","")
    Str=Replace(Str,chr(39),"")            '过滤SQL注入
    Str=Replace(Str,chr(91),"")            '过滤SQL注入[
    Str=Replace(Str,chr(93),"")            '过滤SQL注入]
    Str=Replace(Str,chr(37),"")            '过滤SQL注入%
    Str=Replace(Str,chr(59),"")            '过滤SQL注入
    Str=Replace(Str,chr(43),"")            '过滤SQL注入;
    Str=Replace(Str,chr(45),"")            '过滤SQL注入+
    Str=Replace(Str,chr(123),"")            '过滤SQL注入{
    Str=Replace(Str,chr(125),"")            '过滤SQL注入}
    checkStr=Str            '返回经过上面字符替换后的Str
    if isnull(str) then
  checkStr = ""
  exit function 
end if
end function
