php 输出div,echo <div...
这样写怎么错了,是每个div标签都要echo吗??请教下各位。echo"<divclass='hotel-list'><divclass='pic'><ahref='#'...
这样写怎么错了,是每个div标签都要echo吗??请教下各位。
echo "<div class='hotel-list'>
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class=‘con’>
<h3><a href=‘#’> ".$row[‘name’] ."</a><span><img src=‘../style/images/star_" .$row["star"].".png’’/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class=‘price’>
<p>128元<span>起</span></p>
<a href=‘# ’>查看酒店</a>
</div>
</div>"
Parse error: parse error in D:\wamp\www\yundou\hotel\show_hotel.php on line 84
$j = 1;
while( $row = mysql_fetch_assoc($result) and $j <= $records_per_page)
{
echo "<div class='hotel-list'>
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class=‘con’>
<h3><a href=‘#’> ".$row["name"] ."</a><span><img src=‘../style/images/star_" .$row["star"].".png’’/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class=‘price’>
<p>128元<span>起</span></p>
<a href=‘# ’>查看酒店</a>
</div>
</div>"
$j++;
} 展开
echo "<div class='hotel-list'>
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class=‘con’>
<h3><a href=‘#’> ".$row[‘name’] ."</a><span><img src=‘../style/images/star_" .$row["star"].".png’’/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class=‘price’>
<p>128元<span>起</span></p>
<a href=‘# ’>查看酒店</a>
</div>
</div>"
Parse error: parse error in D:\wamp\www\yundou\hotel\show_hotel.php on line 84
$j = 1;
while( $row = mysql_fetch_assoc($result) and $j <= $records_per_page)
{
echo "<div class='hotel-list'>
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class=‘con’>
<h3><a href=‘#’> ".$row["name"] ."</a><span><img src=‘../style/images/star_" .$row["star"].".png’’/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class=‘price’>
<p>128元<span>起</span></p>
<a href=‘# ’>查看酒店</a>
</div>
</div>"
$j++;
} 展开
2个回答
展开全部
echo "<div class='hotel-list'>
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class='con'>
<h3><a href='#'> ".$row['name'] ."</a><span><img src='../style/images/star_" .$row["star"].".png'/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class='price'>
<p>128元<span>起</span></p>
<a href='#'>查看酒店</a>
</div>
</div>";
你单引号写错了
<div class='pic'><a href='#'><img src='../images/hotel/ ".$row["id"] .".jpg' border='0'/></a></div>
<div class='con'>
<h3><a href='#'> ".$row['name'] ."</a><span><img src='../style/images/star_" .$row["star"].".png'/></span></h3>
<ul>
<li>地址:" .$row["address"]. " </li>
<li>设施:" .$row["facility"]." </li>
<li>简介:" .$row["introduction"]. "</li>
<li><b>酒店电话:</b><p>" .$row["phone"]."</p></li>
</ul>
</div>
<div class='price'>
<p>128元<span>起</span></p>
<a href='#'>查看酒店</a>
</div>
</div>";
你单引号写错了
展开全部
兄弟,你可以试下这个:
<?php
echo <<<EOT
<div>这里可以写HTML内容</div>
<p>是的,而且不用任何顾忌!</p>
<script type="text/javascript">alert("没错,我还能执行Javascript脚本!");</script>
EOT;
?>
<?php
echo <<<EOT
<div>这里可以写HTML内容</div>
<p>是的,而且不用任何顾忌!</p>
<script type="text/javascript">alert("没错,我还能执行Javascript脚本!");</script>
EOT;
?>
更多追问追答
追问
还是 报错 Parse error: parse error in D:\wamp\www\yundou\hotel\show_hotel.php on line 84
追答
是不是你其它的代码有错呀?
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询