单击链接后,我喜欢在 show.php 文件中捕获以下标记的 id ...我已经在 show.php 中获得了 href 名称
<?php
if (isset($_GET['submit'])) {
$choice=$_GET['prod'];
$dbc=mysqli_connect('localhost','root','','online_shopping') or die('Connection Error');
$query1="SELECT name, id from ".$choice; $result1=mysqli_query($dbc,$query1) or die('Error querying Database');
echo "<h1>List of available products in your category</h1><hr>";
while($row = mysqli_fetch_array($result1)) {
$id=$row['id'];
?>
<a style="font-size:18px; text-decoration:none; text-align:center; color:#09F;" href="show.php?ref=<?php echo $row['name'];?>" id="<?php echo $id;?>"><?php echo $id;echo '.'.$row['name']; echo '</a>';