繁体   English   中英

jQuery对话框确认到具有PHP变量的特定href链接

[英]Jquery dialog confirmation to a specific a href link with php variable

当我按一下以从数据库中删除一个项目时,我想弹出一个jQuery确认对话框,上面的代码在一段while($records=mysql_fetch_aray)所以我有几条记录:

echo"<tr>
    <td>".$registo["id_produto"]."</td>
    <td><img src='data:image/jpeg;base64,".base64_encode($registo["pic"])."' width='80' height='80'></td>
    <td>".$registo["nome"]."</td>
    <td>".$registo["preco"]."</td>
    <td>".$registo["quantidade"]."</td>
    <td>".$categoria."</td>
    <td>".$registo["descricao"]."</td>
    <td>".$registo["cura"]."</td>
    <td>".$registo["aroma"]."</td>
    <td><a href='deleteProduto.php?id={$registo["id_produto"]}'><i class='fa fa-times'></i> Delete</a></td>
    </tr>";

当我按下“删除”按钮时,我想弹出一个带有“是”和“否”的jquery确认对话框,当按下“是”时,请转到“ deleteProduto.php”,并带有要删除的项目的相应ID。

我已经搜索过此内容,但只发现它可以与表单一起使用,并且我只希望它与带有相应“ id”的“ a href”链接一起使用。

我不知道您的代码在没有大量警告和错误的情况下是如何工作的。

我认为您可能没有注意到它,因为您在其余代码中正确地做到了,但是

"...?id={$registo["id_produto"]}'>...";

绝对没有适当的字符串组成。 不一定要

"...?id=".$registo["id_produto"]."'>...";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM