gpt4 book ai didi

php - $_GET 不起作用

转载 作者:行者123 更新时间:2023-11-29 12:18:53 25 4
gpt4 key购买 nike

首先列出产品 ID、产品名称以及编辑和删除选项。当我单击删除时,它应该询问"is"或“否”选项,但它不显示。这里 $_GET['deleteid'] 不起作用,因此 echo $delid 也不起作用。没有显示错误,也没有任何反应。

$product_list .= "$id - $product_name       
<a href='inv_edit.php?pid = $id'>edit</a> |
<a href='inventory_list.php?deleteid = $id' >delete</a></br>" ;

if (isset($_GET['deleteid'])) {
$delid = $_GET['deleteid'];
echo $delid;
echo 'Do you really want to delete product with ID of '.
$_GET['deleteid'] . '?
<a href="inventory_list.php?yesdelete=' . $_GET['deleteid'] .
'">Yes</a> | <a href="inventory_list.php">No</a>';
exit();
}

最佳答案

请尝试使用此代码。

$product_list .= "$id - $product_name &nbsp; &nbsp; &nbsp; 
<a href='inv_edit.php?pid=$id'>edit</a> |
<a href='inventory_list.php?deleteid=$id' >delete</a></br>" ;

我删除了空格,例如deleteid=$id 而不是 ?deleteid = $id。

关于php - $_GET 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29345446/

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