php 防 sql注入

网络整理 - 07-27
没有太多的过滤,主要是针对php和mysql的组合。
一般性的防注入,只要使用php的 addslashes 函数就可以了。

以下是一段copy来的代码:

PHP代码

  •   
  • {  
  • if (!get_magic_quotes_gpc()) {  
  • }  
  • else {  
  • }  
  • }  
  • }