HTML-带有弹出窗口的href

时间:2020-07-21 09:04:39

标签: php html

我有两个这样的按钮:

<?php
<td>
<a href='delete.php?id={$row['id']};' class='aRSCSSDesign'>Updatestatus</a>
<a href='delete.php?id={$row['id']};' class='aRCSSDesign'>Delete status</a>
</td>
?>

如何将弹出消息添加到“删除状态”,并询问“您确定要删除此内容吗?”,如果用户按“确定”,则在此处设置删除代码吗?像这样的东西:https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_confirm

1 个答案:

答案 0 :(得分:0)

?php
 $id_one = 1;
 $id_two = 2;
echo "
<td><a onClick=\"javascript: return confirm('Please confirm deletion');\" href='delete.php?id=".$id_one."'>Updatestatus</a>
<a onClick=\"javascript: return confirm('Please confirm deletion');\" href='delete.php?id=".$id_two."'>Delete Status</a>
<td>

";
?>