jdm95lude Posted December 17, 2008 Share Posted December 17, 2008 So this is what I want to do. I want to gather all of the information entered into a form and store it into a session. What is the most practical and reasonable way of going about this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/137276-help-with-sessions/ Share on other sites More sharing options...
MasterACE14 Posted December 17, 2008 Share Posted December 17, 2008 <?php // run your checks on the values, make sure something was entered etc... // then store the info into session vars $_SESSION['user'] = $_POST['user']; // use your session var echo $_SESSION['user']; ?> Regards, ACE Quote Link to comment https://forums.phpfreaks.com/topic/137276-help-with-sessions/#findComment-717241 Share on other sites More sharing options...
premiso Posted December 17, 2008 Share Posted December 17, 2008 Small edit to master's code. He forgot to add the session_start. You will need that at the very top of each page that uses sessions. <?php session_start(); // required before any output for sessions. // run your checks on the values, make sure something was entered etc... // then store the info into session vars $_SESSION['user'] = $_POST['user']; // use your session var echo $_SESSION['user']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137276-help-with-sessions/#findComment-717276 Share on other sites More sharing options...
MasterACE14 Posted December 17, 2008 Share Posted December 17, 2008 ah yes, good catch premiso , cheers Quote Link to comment https://forums.phpfreaks.com/topic/137276-help-with-sessions/#findComment-717310 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.