I have a page with a form which uses a captcha. This all works great, except when the user clicks their backbutton in firefox. They get back to the form ok, but the old (used) captcha image is still there. For some reason, firefox doesn't refresh when the back button is pressed. I thought that if I used javascript to refresh the image that might solve the problem, but apparently firefox doesn't execute javascript when the back button is pressed either. I finally worked out a system where it changes the image when the submit button is clicked, but it doesn't work all the time. Can someone please help me refresh my captcha when the back button is pressed in firefox? Thanks a lot.
You can attempt to prevent FireFox from caching that page: <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?> Code (markup): See PHP documentation for header() for more information.
THX AliasXNeo My captcha.php used no-cache,But another php file used session_cache_limiter() function to keep user's input when validate fail and window.history.back(),it's incompatible... To resolve this,I have to use <input name="captcha" onfocus="if(isFF) reloadcaptcha();" Code (markup): But still, Not perfect...