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. Link to comment https://forums.phpfreaks.com/topic/123408-solved-to-use-a-session-variable/ 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. Link to comment https://forums.phpfreaks.com/topic/123408-solved-to-use-a-session-variable/#findComment-637422 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 Link to comment https://forums.phpfreaks.com/topic/123408-solved-to-use-a-session-variable/#findComment-637445 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... Link to comment https://forums.phpfreaks.com/topic/123408-solved-to-use-a-session-variable/#findComment-637520 Share on other sites More sharing options...
revraz Posted September 9, 2008 Share Posted September 9, 2008 Mark as solved please Link to comment https://forums.phpfreaks.com/topic/123408-solved-to-use-a-session-variable/#findComment-637524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.