View product attributes function
1, Jump page design

##Code:
<?php <a title="查看商品详细信息" href="goodsshow.php?id=<?php echo $row["id"]?>"><?php echo $row["title"]?></a>
2, Shopping cart page display
Create a new goodsshow.php file
<?php
header("Content-type:text/html;charset=utf-8");
include "mysqli.php";
?>
<?php
$id=isset($_GET["id"])?$_GET["id"]:1;
$sql="update goods set hits=hits+1 where id=".$id;
$mysqli->query($sql);
$sql="select *from goods where id=".$id;
$result=$mysqli->query($sql);
while($row=$result->fetch_assoc()){
?>
<div>
<span><?php echo $row["title"] ?></span>
<hr>
<image src="<?php echo $row["picurl"] ?>" width="200"></image>
<br>
数量:-<input type="text" id="buynum" value="1">+
价格:
<del>市场价:<?php echo $row["marketprice"] ?></del>
出售价:<i style="color: red"><?php echo $row["salesprice"] ?></i>
<input type="hidden" id="id" value="<?php echo $row["id"] ?>">
<hr>
内容:<?php echo $row["content"] ?><br>
<a href="javascript:;" onclick="">立刻购买</a> <a href="javascript:;" onclick="">加入购物车</a>
<?php
}
?>
</div>Because shopping websites basically count the number of clicks on which product a user clicks on, here we also add one to the hits field every time a user clicks
$sql="update goods set hits=hits 1 where id=".$id;
3, the effect is shown as follows:
new file
<?php
echo "查看商品属性功能展示";
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















