商品详情页面展示
1,商品详情页面展示前端页面
新建goods.php文件,代码如下:
<?php
header("Content-type:text/html;charset=utf-8");
include "mysqli.php";
?>
<h1>商品列表</h1>
<div style="float: none;width: 600px">
<?php
$sql="select *from goods";
$result=$mysqli->query($sql);
?>
<table border="1" cellpadding="3" cellspacing="0" width="60%">
<tr bgcolor="skyblue">
<?php
while($row=$result->fetch_assoc()){
?>
<td >
<image width="200px" height="200px" src="<?php echo $row["picurl"]?>"></image>
<a title="查看商品详细信息" href="goodsshow.php?id=<?php echo $row["id"]?>"><?php echo $row["title"]?></a>
</td>
<?php
}
?>
</tr>
</table>
</div>2,前端页面展示如下:

