我想在 php 中创建一个确认是/否框 我的代码是这样的:
<?php
if(isset($_REQUEST['id']))
{
?>
<script>
var cf=confirm("do you want to delete Y/N");
if(cf)
{ i want to call code edit of php
}
</script>
<?php
}
?>
<html>
<head>
</head>
<body>
<form name="frm" method="post" action="edit.php">
<a href="edit.php?id=1">Edit </a> <br>
<a href="edit.php?id=2">Edit </a> <br>
<a href="edit.php?id=3">Edit </a> <br>
</form>
</body>
</html>
我想在按"is"时调用 PHP 中的代码编辑 但它不起作用。 你能帮助我吗 ? 谢谢你
最佳答案
只需使用内嵌的 onclick 事件。
这是一个简单的技术,您可以在您的 PHP 页面中使用它。
<a href="edit.php?id=1" onclick="return confirm('do you want to delete Y/N')">Edit </a>
关于php - 如何在 php 中创建确认是/否?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36907601/