I want to create a confirm yes/no box in php my code like this:
<?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>
I Want to when press Yes i call code edit in PHP But it do not work. Can you help me ? Thanks you
Just use inline onclick event.
This is a simple techique, you can use it in your PHP page.
<a href="edit.php?id=1" onclick="return confirm('do you want to delete Y/N')">Edit </a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With