function quotesGPC()
{
    $_POST  = array_map( "addSlash", $_POST );
    $_GET  = array_map( "addSlash", $_GET );
    $_COOKIE = array_map( "addSlash", $_COOKIE );
}
function addSlash( $el )
{
    if( is_array( $el ) )
       return array_map( "addSlash", $el );
    else
       return addslashes( $el ); 
}if( !get_magic_quotes_gpc() )
quotesGPC();

解决方案 »

  1.   

    XOOPS Protector 2.21 中文版http://xoops.org.cn/modules/wfdownloads/singlefile.php?cid=8&lid=224建议参考~
      

  2.   

    我支持XOOPS Protector 2.21 中文版
      

  3.   

    Xoops Protector is a module to defend XOOPS2 from various and malicious attacks.This module can protect four kind of attacks like:- DoS
    - SQL Injection
    - XSS
    - System global variable pollution
      

  4.   

    刚好也在研究这个问题.#主要还是在PHP程序中控制.
    数值型的 $i=0+$i;
    字符型的 mysql_escape_string 转义掉
    mysql 所有查询 变量 加上''#PHP.ini中
    safe_mode = On
    display_errors=off
    magic_quotes_gpc=On这样应该是无法注入了.
    呵呵,还望高手指正.
      

  5.   

    Xoops Protector
    如何用?谁提示一下?