<script language="JavaScript"> window.onbeforeunload = confirmExit; function confirmExit() { window.location.href="delete.php"; } </script>