首页
印 像 新 闻 系 统
网站首页 公告信息 编程实例 PHP函数 摄影无界 全景展示 我的作品 意见专栏
 

过滤非法字符防止SQL注入

【2006年01月23日 22:14: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


(『印像空间』 【本文来源:『学习笔记』】 【作者:未知】 【录入:留印】)
限200字,剩余 字
关 键 字:
    
搜索条件: