我想弄清楚如何防止sqlinjection,我写了这个基本功能:function
antiInjectie($inputfromform){
$temp = str_replace("'", "`",$inputfromform);
$temp = str_replace("--", "~~",$temp);
return htmlentitites($temp);
}
然而有人告诉我也要考虑十六进制值,但我该怎么做?
更新
我坚持使用MDB2和pgsql
解决方法:
Bobby-Tables有一个很好的指导来防止SQL注入.
简而言之:不要自己扭曲输入,使用允许绑定参数的数据库API方法.
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!