i'm reposting this post i just posted a while ago. http://stackoverflow.com/questions/1035266/how-do-i-write-a-javascript-alert-box-to-give-a-yes-or-no-question-and-integrate/1035285#1035285
i wasnt getting anymore responses so i figured the post got lost in somewhere out there. what i tried doing was this
<script type="text/javascript">
if(window.confirm("Are you sure you want to delete that record?")) {
<?php
mysql_query("delete from tbl_payments where id = '$id'") or die(mysql_error());
header("Location: dashboard.php");
?>
}
</script>
and it didnt work. the record just got deleted once i pressed the link to delete. what am i doing wrong? thanks
ps: i cant do ajax yet im looking for a simple way of doing it so i can comprehend how it works
thanks