分析错误:语法错误,第1003行C:\xampp\htdocs\sb\templates\skm\index.php中的文件意外结束
我试图在我的本地主机上修改joomla网站,在更改配置文件中的详细信息后,我得到以下错误分析错误:语法错误,第1003行C:\xampp\htdocs\sb\templates\skm\index.php中的文件意外结束,php,joomla,Php,Joomla,我试图在我的本地主机上修改joomla网站,在更改配置文件中的详细信息后,我得到以下错误 Parse error:语法错误,第1003行C:\xampp\htdocs\joomla\templates\skm\index.php中的文件意外结束 第1003行是以下代码的最后一行 <?php $spotlight = array ('social'); $botsl = jaTpl_calSpotlight ($spotlight,jaTpl_isOP()?100:99.5)
Parse error:语法错误,第1003行C:\xampp\htdocs\joomla\templates\skm\index.php中的文件意外结束
第1003行是以下代码的最后一行
<?php
$spotlight = array ('social');
$botsl = jaTpl_calSpotlight ($spotlight,jaTpl_isOP()?100:99.5);
if( $botsl ) {
?>
<!-- BOTTOM SPOTLIGHT-->
<div id="botsl1" class="wrap">
<div class="main clearfix">
<div class="main-inner1 clearfix">
<?php if( $this->countModules('social') ) {?>
<div class="ja-box ja-box<?php echo $botsl['social']['class']; ?>" style="width: <?php echo $botsl['social']['width']; ?>;">
<jdoc:include type="modules" name="social" style="xhtml" />
</div>
<?php } ?>
</div>
</div>
</div>
<!-- //BOTTOM SPOTLIGHT -->
<?php } ?>
<div id="footer1" class="wrap1">
<div class="main clearfix">
<jdoc:include type="modules" name="footer1" style="xhtml" />
<!-- <jdoc:include type="modules" name="footer" style="xhtml" /> -->
</div>
</div>
<jdoc:include type="modules" name="debug" />
</div>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/js/wall.js"></script>
</body>
<script>
/* var ifr='<?php echo JRequest::getVar('ifr'); ?>';
var last_clicked;
window.onclick = function(e) {
last_clicked = e.target;
if (last_clicked.href) {
var new_url = last_clicked.href+"&ifr=true";
// alert(new_url);
e.preventDefault();
window.location = new_url;
last_clicked = '';
}
} */
</script>
</html>
<?php }
?>
如评论中所述,您缺少一个或多个结束括号 我建议您使用另一种方法执行
else if
语句,以避免在使用类似HTML的语句时出现以下错误:
<?php if($this->countModules('social')):?>
<!-- your HTML -->
<?php elseif($this->countModules('anotherInput')):?>
<!-- your HTML -->
<?php endif; ?>
也适用于
for
和foreach
语句。您缺少一个结束的花括号缺少了吗?还是太多了?你有一个额外的封闭的卷曲括号。您已经在
之后关闭了它。任何像样的IDE,比如netbeans,都会告诉你哪里出了问题。@putvande PHP不在乎你有多少个括号。。只是他们都关门了。