Forum Moderators: coopster
<script language="javascript">
window.onbeforeunload = function() {
window.setTimeout(function () {
window.location = 'page.php';
}, 0);
window.onbeforeunload = null; // necessary to prevent infinite loop, that kills your browser
}
</script> Reason for this is because the page in question sends out an email and makes an entry into a database when it loads and does the same if refreshed.
The problem is, the page, until the time is up submits a new code to the db with a new expiration period (controlled with a timestamp) with a page refresh.
I'm looking for a way using php to make it impossible to keep getting new codes submitted to the db by simply refreshing the page