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确认对话框,其中包含"是"answers"否",当按下"是"时,转到"deleteproduct .php",其中包含我想要删除的项目的相应id。
我已经搜索了这个,但只发现这个工作与一个形式,我只希望它与'a href'链接与各自的"id"工作
我想知道你的代码如何在没有大量警告和错误的情况下工作。
我想你可能没有注意到它,因为你在剩下的代码中做得很正确,但是
"...?id={$registo["id_produto"]}'>...";
绝对不是正确的字符串组合。必须是
"...?id=".$registo["id_produto"]."'>...";
相关文章:
- Javascript+动态菜单+当前链接样式(CSS)+基于PHP的网站
- 链接中有php变量的Javascript打开窗口
- 如果函数PHP中的条件为true,则禁用链接
- URL PHP/jQuery的链接预览
- 蛋糕PHP电子邮件 - 包括电子邮件中的链接
- 链接适用于所有浏览器,除了 safari(php 代码)
- 我想通过单击按钮将 2 个 php 文件链接在一起
- 使用php使用href链接将输入的文本框值传递到另一个页面
- 在PHP代码中单击链接javascript函数调用
- 更新用户's使用PHP或JavaScript链接
- 将PHP/MMySQL转移到新的Web服务器,所有链接都会出现标签
- 如何将html表单与php链接,以便在例如单击按钮时返回true
- 链接php锚和散列
- Php菜单查询数据库并显示文本/链接
- 翻译一篇文章'上.单击'PHP中的事件,来自'window.open'到基本URL链接
- 使 PHP 变量成为链接
- 如何设置从数据库到php会话的id点击链接
- 我可以将textfield的值传递到php链接吗
- 写入页面的PHP链接未被JAVASCRIPT函数检索
- Twitter Bootstrap下拉PHP链接未打开