PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Is there anyway in PHP to check if the window has been refreshed?
I've been trying to use this function, but I discovered $_SERVER['HTTP_REFERER'] doesn't return that page if you refresh it, just the one you were to get to this page.
There are several easy ways. The way I commonly use is sessions. Just start a session at the top of the page. Then on the page you want protected do something like this:
<?php
if ($_SESSION['check_refresh'] == '4S558FD7s2jDdjdf3') {
echo "Error: Program Breach.";
}else{
$_SESSION['check_refresh'] = '4S558FD7s2jDdjdf3';
}
?>
Then on the page you send the users after they have view the page simply destroy or change the session details.
If your system uses a popup you can simply close the popup.