|
Comments for: tim20000821
| Message # 1019816: |
|
Date: 04/17/04 00:21
By: Alex Livingstone Subject: RE: javascript:history.back() If you add the following to every page on your site in the HEAD section, on pressing the back button they will be redirected to the current page, effectively disabling the back button. <SCRIPT LANGUAGE="JavaScript"> <!--// history.go(1); --> </SCRIPT> If the user has stayed in your site, selecting any page in their history will take them to the current page. If you want to stop any PHP from being executed you would need to set up a session variable as a counter and also a counter in the url. If the counter in the url was less than in the session variable you know that they have pressed the back button and you can then take apropriate action ie exit() or die(). if($urlCounter < $sessionCounter) { die('<SCRIPT LANGUAGE="JavaScript"> <!--//history.go(1);--></SCRIPT>'); } else { $urlCounter++; $sessionCounter++; } All links would then have to be: <? script.php?urlCounter=$urlCounter ?> |
Previous Message | Next Message |


