Jump to content

retaining form info when error catching


CincoPistolero

Recommended Posts

I have a form that when submitted gets sent to another page. This second page does form validation with regex. When an error is encountered, I tried using javascript:history.back() but it won't return the previous page, it tells me the webpage has expired. So, I'd like to be able to return to the previous page and retain what had been entered.

 

Any ideas or hints appreciated.

Link to comment
https://forums.phpfreaks.com/topic/182183-retaining-form-info-when-error-catching/
Share on other sites

this would happen if the previous page would be posted too, there are ways to avoid the page has expired, you could add these headers to your previous page

 

  1. Expires: Thu, 19 Nov 1981 08:52:00 GMT

  2. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

  3. Pragma: no-cache

 

I worked on something similiar quite a while ago cannot remember what were the drawbacks :P

post the variables store them in variables. rdirect to the page if u know which page name it is. then echo the variables in the values of the inputs or whatever. if they are empty then they will be empty..

 

make sure they click a form botton to go back to the page so that form will post the "hidden" variables

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.