Need to Reload/Refresh page after a Back is done, keeping prev data entered on that page
Refresh Page After Back Button Hit
Trying to add a captcha to a website. I am using code that I found on line, and it has to work. When the user enters a code, the htm code calls a php file that checks validity. If invalid, I have a message and sent the user back to the form/htm page and their previously entered data still displays - as well as the old invalid code they entered AND the old displayed captcha image. At this point, the actual captcha code and the displayed captcha code are out of synch. Using the related reload link for the captcha image takes care of the problem, as does a refresh - the code and displayed code will match, the users previous data is still available, and the user just has to change the code that was previously entered as the codes have changed. Failure to refresh/reload the captcha image or the page will create a mismatch again.
Need to know how to solve this:
1.) Need to have the page refresh after doing back - this resolves the problem w/o the user having to do anything.
2.) Another way to handle this which is even better - How does one go about submitting the users data for check, and having the original forms page display an error message, clear out the user entered invalid code, and refresh the displayed captcha code? This way, the user is still on the same form page, their data is still present, they get a message indicating that the codes didnt match, and new codes are available for another try...
Neophyte in the coding, but understand the algorithms/logic and behind it. Just need to the code, etc. Currently, I am pulling back a cached form/htm page with data, that apparently kicks off a new code, leaves the users input available (which is good), but the captcha displayed code is not refreshed, and that is the big issue with the current set up. (clearning out the user entered code too would be nice).
Have tried using what I have found here in the forums, but various caching code doesnt seem to take care of it. Putting in a refresh/reload into the htm code doesn't get run (in my thoughts), since one is doing a BACK in the browser and so this is cached, and actually doing a redirect to the calling forms/htm page will reset everything the user entered - and everyone knows how much that could be hated.
Thanks!
-question by Allen
Comment/Reply (w/o sign-up)