Retaining form data when going back and still using PHP sessions.
February 8, 2008 5:36 AM
Subscribe
When I altered a PHP web form to take advantage of PHP Sessions, I lost the ability to go back a page while retaining data in the form. Is this the expected behaviour, or is it caused by something else?
There are two pages, newentry.php and processentry.php. The first page contains an HTML form whose action is the second page.
The second page does some error checking and alerts the user to go back if something is not correct. I have attempted both javascript:history.back, history.go(-1), and direct links to newentry.php. Before I added Session support, going back to the form returned you to a page with the data still filled in.
Since I added sessions, going back takes you to a blank copy of the form. Is this normal? Is there some other cause I should investigate?
What is the best way to handle this sort of thing? Should I not rely on the first behaviour at all?
posted by odinsdream to computers & internet (8 comments total)
1 user marked this as a favorite
posted by bricoleur at 6:10 AM on February 8, 2008