verdure Posted September 9, 2008 Share Posted September 9, 2008 Hi ... i have the following scenario ... any suggestions on how to include the session variable will be greately appreciated. PAGE A : A list containing values of country names. Submit button PAGE B : ----> This page contains a form with many fields. -->The submitted value (country name)from PAGE A is put in a readonly text field. -->The counties for the country selected are retrieved from the database. On clicking the submit button the form is validated by PAGE C. The error messages are sent back to PAGE B Here is the problem ... when the error messages are displayed. The value of the country field is not retained. I realised i havent included the session variable that is why it is not happening. Could some body please direct me with an example as to how to declare session variable. Quote Link to comment Share on other sites More sharing options...
lanmonkey Posted September 9, 2008 Share Posted September 9, 2008 on page C have some logic that assigns the values sent from page B to a session variable IF errors existed. when the user is sent back to page B have some more logic that will fill out the form using the variables stored in the session if the user was returned back to page B from page C. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted September 9, 2008 Share Posted September 9, 2008 This is why I prefer to have any and all forms submit to themselves and have the processing done on the same page. It negates the need to transfer information back to the previous page. In any case, for an introduction to sessions, I would suggest the examples in the manual: http://uk3.php.net/manual/en/session.examples.php Quote Link to comment Share on other sites More sharing options...
verdure Posted September 9, 2008 Author Share Posted September 9, 2008 thanks folks .... but i kind a figured a solution out myself... Quote Link to comment Share on other sites More sharing options...
revraz Posted September 9, 2008 Share Posted September 9, 2008 Mark as solved please Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.