php中如何避免sql注入攻击

字体大小: 中小 标准 ->行高大小: 标准
if(!get_magic_quotes_gpc()){
callUserFunc($_GET,'addslashes');
callUserFunc($_POST,'addslashes');
}
就可以了,字段值加 ' 就可以了,如查询文章
"SELECT * FROM table WHERE id='$id'"

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/83.html