简体   繁体   English

解析错误:语法错误,意外的“已定义”(T_STRING)

[英]Parse error: syntax error, unexpected 'defined' (T_STRING)

I'm using php 5.4 version. 我正在使用php 5.4版本。 I got the problem after I upload my Joomla cms folder from my localhost to my webhosting. 从本地主机将Joomla cms文件夹上传到Web托管后,出现了问题。

This is the code 这是代码

<?php

defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');

// Create shortcuts to some parameters.
$params  = $this->item->params;
$images  = json_decode($this->item->images);
$urls    = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user    = JFactory::getUser();
$info    = $params->get('info_block_position', 0);
JHtml::_('behavior.caption');
$useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') ||          $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params-   >get('show_parent_category') || $params->get('show_author'));

?>

I get this error 我得到这个错误

Parse error: syntax error, unexpected 'defined' (T_STRING) in /home/u854215895/public_html/templates/realestate/html/com_content/article/default.php on line 1 解析错误:语法错误,第1行/home/u854215895/public_html/templates/realestate/html/com_content/article/default.php中意外的'defined'(T_STRING)

Please help... Thanks 请帮忙...谢谢

Remove the space from here 从这里删除空间

$params-   >get('show_parent_category')
       --^--

So it goes like this. 就像这样。

$useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') ||          $params->get('show_create_date')
        || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author'));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM