懂PHP的进来一下帮忙解决个问题
网页显示Parseerror:syntaxerror,unexpectedT_DOUBLE_ARROWin/data/home/qxu0100220/htdocs/wap...
网页显示Parse error: syntax error, unexpected T_DOUBLE_ARROW in /data/home/qxu0100220/htdocs/wap/category.php on line 31
是怎么回事
是category.php出错了吗?
我把这个文件内容贴出来,求大神帮忙回答一下怎么解决!
<?php
define('IN_PHPMPS', true);
require dirname(__FILE__) . '/include/common.inc.php';
if(isset($_REQUEST['id']))$catid = intval($_REQUEST['id']);
if($catid) {
$cat_info = get_cat_info($catid);
if(empty($cat_info)) {
header("Location: ./");
exit;
}
}
$cat_row = get_cat_children($catid, 'array');
if(!empty($cat_row)) {
$cat_arr = array();
foreach($cat_row as $val) {
$val['catname'] = $val['name'];
$val['url'] = url_rewrite('category',array('cid'=>$val['id'],'eid'=>$areaid));
$cat_arr[] = $val;
}
$cats = get_cat_children($catid);
}
if(empty($cats))$cats = $catid;
$cat_sql = " and i.catid in ($cats) ";
$page = empty($_REQUEST['page']) ? '1' : intval($_REQUEST['page']);
$sql = "SELECT COUNT(*) FROM {$table}info as i WHERE is_check=1 $cat_sql $area_sql";
$count = $db->getone($sql);
$size = '20';
$pager['search'] = array_merge('catid'=>$catid, 'areaid'=>$areaid);
$pager = get_pager('category.php',$pager['search'],$count,$page,$size);
$sql = "SELECT id,title,postdate,enddate,i.catid,c.catname,i.areaid,a.areaname,thumb,i.description FROM {$table}info AS i LEFT JOIN {$table}category AS c ON i.catid=c.catid LEFT JOIN {$table}area AS a ON a.areaid=i.areaid WHERE is_check=1 $cat_sql $area_sql ORDER BY postdate DESC limit $pager[start],$pager[size]";
$res = $db->query($sql);
$info = array();
while($row=$db->fetchRow($res)) {
$row['url'] = url_rewrite('view',array('vid'=>$row['id']));
$row['postdate'] = date('y年m月d日', $row['postdate']);
$row['lastdate'] = enddate($row['enddate']);
$row['intro'] = cut_str($row['description'], 50);
$info[$row['id']] = $row;
}
$seo['title'] = $cat_info['catname'] . '信息列表 - Powered by Phpmps';
include tpl('category');
?> 展开
是怎么回事
是category.php出错了吗?
我把这个文件内容贴出来,求大神帮忙回答一下怎么解决!
<?php
define('IN_PHPMPS', true);
require dirname(__FILE__) . '/include/common.inc.php';
if(isset($_REQUEST['id']))$catid = intval($_REQUEST['id']);
if($catid) {
$cat_info = get_cat_info($catid);
if(empty($cat_info)) {
header("Location: ./");
exit;
}
}
$cat_row = get_cat_children($catid, 'array');
if(!empty($cat_row)) {
$cat_arr = array();
foreach($cat_row as $val) {
$val['catname'] = $val['name'];
$val['url'] = url_rewrite('category',array('cid'=>$val['id'],'eid'=>$areaid));
$cat_arr[] = $val;
}
$cats = get_cat_children($catid);
}
if(empty($cats))$cats = $catid;
$cat_sql = " and i.catid in ($cats) ";
$page = empty($_REQUEST['page']) ? '1' : intval($_REQUEST['page']);
$sql = "SELECT COUNT(*) FROM {$table}info as i WHERE is_check=1 $cat_sql $area_sql";
$count = $db->getone($sql);
$size = '20';
$pager['search'] = array_merge('catid'=>$catid, 'areaid'=>$areaid);
$pager = get_pager('category.php',$pager['search'],$count,$page,$size);
$sql = "SELECT id,title,postdate,enddate,i.catid,c.catname,i.areaid,a.areaname,thumb,i.description FROM {$table}info AS i LEFT JOIN {$table}category AS c ON i.catid=c.catid LEFT JOIN {$table}area AS a ON a.areaid=i.areaid WHERE is_check=1 $cat_sql $area_sql ORDER BY postdate DESC limit $pager[start],$pager[size]";
$res = $db->query($sql);
$info = array();
while($row=$db->fetchRow($res)) {
$row['url'] = url_rewrite('view',array('vid'=>$row['id']));
$row['postdate'] = date('y年m月d日', $row['postdate']);
$row['lastdate'] = enddate($row['enddate']);
$row['intro'] = cut_str($row['description'], 50);
$info[$row['id']] = $row;
}
$seo['title'] = $cat_info['catname'] . '信息列表 - Powered by Phpmps';
include tpl('category');
?> 展开
展开全部
消除下缓存试试,也可能是模板问题,出现不对称的标签,所以需要修改或者看看问题,你进不去就做不到这些了。
解决方法:
1、将代码中的<? ?>全部替换成<?php ?>
2、打开 php.ini ,找到 short_open_tag = Off 这一行,将 Off 修改为 On,保存退出并重启 Apache 即可解决问题
parse error 意思是解析错误;语法错误;分析错误
syntax error 意思是:句法误差
unexpec 意思是:没有料到的,想不到的,意外的
展开全部
array_merge 参数给错了嘛,应该给两个数组呀,没你那种写法的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
$pager['search'] = array_merge('catid'=>$catid, 'areaid'=>$areaid); 这一行改成
$pager['search'] = array_merge(array('catid'=>$catid, 'areaid'=>$areaid));
$pager['search'] = array_merge(array('catid'=>$catid, 'areaid'=>$areaid));
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
就是简单的语法错误,这个还是要自己再检查检查,毕竟不是什么太难的事,自己也可以得到提升,相信你可以解决的,呵呵
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询