Form problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Form problem

Post 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
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post 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. :)
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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...
Post Reply