Parse error: syntax error, unexpected $end in /home/u982799381/public_html/bbs/read.php on line 53
这个是怎么个错误?看不明白不会改,求教…
<?php
$bt="日记查看";
include("../conn.php");
include("../top.php");
include_once("../function.php");
$sid = sqlstr($_COOKIE['dl']);
$uin=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$id=$uin['id'];
$page= $_GET['page'];
$tid=sqlstr($_GET['tid']);
echo <<<htm
<div class="hui"><div class="zuo">日记本本</div><div class="you"><a href="diary.php">我的日记</a> | <a href="diandi.php">点滴</a></div></div>
<div class="wz"><p><span>记得每天写下一篇日记</span></p> <p>某天回阅;那些依然是最美的回忆</p></div>
htm;
$uinfo=mysql_fetch_array(mysql_query("select * from tie where tid='$tid'"));
$zt=$uinfo["tzzt"];
$nr=$uinfo["tznr"];
$time=ctime($uinfo['ftime']);
$uid=$uinfo["uid"];
$user=mysql_fetch_array(mysql_query("select * from user where id='$uid'"));
$tx=$user["tx"];
$qm=$user["qm"];
$nick=$user["nick"];
$ip="UPDATE tie SET ip=ip+1 WHERE tid='$tid'";
mysql_query($ip,$conn);
echo '<div class="article">
日记主题:'.$zt.'
日记主人:<a href="../user/index.php?id='.$uid.'">'.$nick.'</a>(id:'.$uid.')<a href="../user/addatt.php?id='.$uid.'">+关注作者</a>
发布时间:'.$time.'
</div>
'.$nr.'<hr/>';
echo '『回复列表』
';
$hfmax=mysql_num_rows(mysql_query("SELECT * FROM hf WHERE tid='$tid'"));
$rs=mysql_query("SELECT * FROM tie WHERE tid='$tid' ORDER BY ftime DESC LIMIT 3");
while($uinfo=mysql_fetch_array($rs)){
$uid=$uinfo['uid'];
$hftxt=$uinfo['hftxt'];
$hid=$uinfo['hid'];
$time=ctime($uinfo['hftime']);
$vvv=mysql_fetch_array(mysql_query("SELECT * FROM user WHERE id='$uid'"));
$nick=$vvv['nick'];
echo '
'.$hid.'楼:'.$hftxt.'(<a href="../user/user.php?id='.$uid.'">'.$nick.'</a>/'.$time.')<hr/>
';
if(empty($huimax)){
echo '没有回复,快抢沙发哦……';
}
if($huimax>3){
echo '<a href="./hflist.php?tid='.$tid.'">>>查看更多回复('.$huimax.')</a><hr>';
}
echo '
<form action="hf.php?tid='.$tid.'" method="POST">
<p><textarea name="hftxt" wrap="virtual" style="width:90%;height:60px;" class="kuang"></textarea></p>
<input class="libbtn" name="libreg" type="submit" value="回复" /> <a href="index.php">返回>></a></form>
';
?>
<?php
include('../foot.php');
foot_staring();
?>
一般出现"
syntax error, unexpected $end";
特别是$end,就是说结尾的时候少了或多了"}"
目测你只有while(){
后面的 } 不见了
$sql=" `title` LIKE '%{$_GET['kw']}%'";
$rs=$DB->query("select * from wu_bbs_txt where {$sql} order by id {$by} limit $start,$size");
以上是在我论坛搜索时执行的sql,`title`LIKE '%关键词%'
搜索结果会是:金属cp-1,塑料cp-1,木材cp-1,cp-1金属,cp-1塑料,cp-1木材,木材cp-1木材,塑料cp-1塑料,
改为
$sql = "SELECT * FROM `#@__news` where title like '%$keyword' ORDER BY addtime DESC";
搜索结果会是:金属cp-1,塑料cp-1,木材cp-1
如果
$sql = "SELECT * FROM `#@__news` where title like '$keyword%' ORDER BY addtime DESC";
搜索结果会是:cp-1金属,cp-1塑料,cp-1木材
% 是通配符
$max= "SELECT * FROM bbs where bname like '%$bname%' ORDER BY cjtime DESC";