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 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 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']; ?> 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 Link to comment https://forums.phpfreaks.com/topic/137276-help-with-sessions/#findComment-717310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.