Click to See Complete Forum and Search --> : Can I take a page out of history?
Mike Burdick
09-15-2004, 03:41 AM
Sorry for the bad play on words in the title, but here's my situation:
I have a form that sends information back to a CGI (perl) for processing. When updated, the form is sent back to the user.
But, if the user clicks on their browsers back button they naturally go back to the "unprocessed" form. Is there any way I can get rid of this previous page and thereby eliminate this potential problem?
Thanks for your attention...Mike
I doubt it. You could try checking the referring page's address, but that may be incorrect as the pages in history are cached. Perhaps set up session cookies and, when they submit the form to be processed, check to see if it's set; if it is, they have already submitted the form and display an error message telling them to re-begin the entire process. If not, they haven't submitted the form, and so the form should be processed as normal.
Jeff Mott
09-15-2004, 09:05 AM
I think your best bet would be to set an expiration date on the form page so that it expires immediately. I'm sure we've all seen one of those pages where we try to go back and get "Warning: Page has expired".
Mike Burdick
09-15-2004, 12:05 PM
Thanks Jona, and Jeff for your help!
Jeff, how does one set up a page expiration date?
Thanks,
-Mike
Mike Burdick
09-16-2004, 01:47 AM
Okay, this works in Firefox, but not Opera or IE:
print header(-type => 'text/html',
-expires =>'now',
-Pragma => 'no-cache',
-Cache_Control => join(', ', qw(no-store no-cache must-revalidate post-check=0 pre-check=0)));
What should I do to get it to work for IE and Opera?
- Mike
I think it's expires="0" not "now" though I could be wrong...