patrickstrijdonck
Programmer
Hi there,
I want to have a confirm box, asking (confirming) the user if its alright to delete.
what i have now is this:
But when i click the button, it will just delete the record without asking,
Am i missing something?
I want to have a confirm box, asking (confirming) the user if its alright to delete.
what i have now is this:
Code:
if ($_POST['DEL'] == 'Personeelslid Verwijderen')
{
?>
<script type="text/javascript">
if (window.confirm("This will change data in the database.
Do you want to go ahead?")) {
<? $persnr = $_SESSION['pznummer'];
$query1="DELETE FROM personeel WHERE Personeelsnummer = '$persnr'";
mysql_query($query1) or die(mysql_error());
header("Location: update.php"); ?>
} else {
// Don't change the data...
}
</script>
<?
}
But when i click the button, it will just delete the record without asking,
Am i missing something?