Jump to content

[SOLVED] "are you sure?"


Zeradin

Recommended Posts

I don't know if this counts as a php question or an sql question or a javascript question but I'm trying to make a "are you sure" alert box for deleting things. like this:

 

<SCRIPT LANGUAGE="javascript">
<!--
function CONFIRM(){if (!confirm
("Are you sure you want to delete?"))
history.go(-1);return " "}
document.writeln(CONFIRM())
<!-- END -->
</SCRIPT>
<?php
// create show query
$dquery = 'delete FROM pms WHERE id = '.$mid.'';
// execute show query
$dresult = mysql_query($dquery) or die ("Error in query: $dquery. ".mysql_error());

 

but if you say cancel it goes back to the last page but still deletes the entry.

how can i fix this? i tried adding a <?php die; ?>

but it didn't work either. Help?

Link to comment
https://forums.phpfreaks.com/topic/123313-solved-quotare-you-surequot/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.