Product details page display
1, product details page display front-end page
Create a new goods.php file, the code is as follows:
<?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, the front-end page is displayed as follows: