gpt4 book ai didi

php - 我想在单击删除按钮后获取 id,但无法在其他页面 php 中发送其值

转载 作者:行者123 更新时间:2023-11-29 17:14:22 25 4
gpt4 key购买 nike

if (mysqli_num_rows($res) > 0) {
while ($row = mysqli_fetch_assoc($res)) {

echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['first_name'] . "</td>";
echo "<td>" . $row['second_name'] . "</td>";
echo "<td>" . $row['contact_no'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['address'] . "</td>";
echo "<td>" . $row['date_created'] . "</td>";
echo "<td> <a href='delete.php' id=".$row['id']."'>Delete</a></td>";
echo "</tr>";

}
}

最佳答案

将值发送到delete.php,如下所示

echo "<td> <a href='delete.php?id=".$row['id']."' id=".$row['id']."'>Delete</a></td>"; 

并获取delete.php上的id值,如下所示

$id = $_GET['id'];

关于php - 我想在单击删除按钮后获取 id,但无法在其他页面 php 中发送其值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51720326/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com