Page 1 of 1

Form problem

Posted: Mon Aug 23, 2004 5:31 am
by mzfp2
My website is using sessions and I seem to have discovere a problem with a form on my site.

When the simple form is submitted, a PHP scipt is used to process the form (which uses a session).

However at this stage if the user presses BACK on the browser to edit the information in the form, everything in form will be cleared.

Is there anyway to prevent this from occuring ?

Many thanks

Musaffar

Posted: Mon Aug 23, 2004 6:41 am
by AngusL
Store the data in a cookie, and when loading that page, check to see if that cookie exists, and if it does, load the data into the form fields would probably work. Sorry, can't give code, as I don't know too much php as of yet. I could do it in ASP, but that's not much use. :)

Posted: Mon Aug 23, 2004 8:56 am
by mzfp2
Hi

Thankyou for your reply, i was hoping the solution wouldn't require any PHP scriptinhg as it seems on some my other websites pressing back doesn't get rid of the data into a form.

Does this only occur when using essions?

Posted: Mon Aug 23, 2004 9:57 am
by feyd
the memory of what were in the fields is all controlled by the browser.. if it wants to toss that info, it will.. we can't do much about it. What we can offer is an in-page link back that will repopulate the fields with the last data they submitted...