TheFilmGod Posted February 14, 2007 Share Posted February 14, 2007 Hi, How do you create php sessions? Also how do you hold those variables that a visitor turns on or does to the next pages he/she goes to. And how to stop the session if that person leaves? I was hoping you can give me some insight. Link to comment https://forums.phpfreaks.com/topic/38414-solved-session-php/ Share on other sites More sharing options...
Wireless102 Posted February 14, 2007 Share Posted February 14, 2007 put session_start(); at the begginning of your code and then you can store session values using $_SESSION['name'] = "name"; $_SESSION['pass'] = "pass"; you can unset the session with unset($_SESSION['name']); and put session_destroy; after the unsets Link to comment https://forums.phpfreaks.com/topic/38414-solved-session-php/#findComment-184259 Share on other sites More sharing options...
redarrow Posted February 14, 2007 Share Posted February 14, 2007 q1 //How do you create php sessions http://uk.php.net/function.session-start q2 //Also how do you hold those variables that a visitor turns on or does to the next pages he/she goes to http://uk2.php.net/variables.predefined q3// And how to stop the session http://uk.php.net/function.session-destroy http://uk.php.net/unset All of the above is an insight good luck. Link to comment https://forums.phpfreaks.com/topic/38414-solved-session-php/#findComment-184264 Share on other sites More sharing options...
TheFilmGod Posted February 14, 2007 Author Share Posted February 14, 2007 Thanks for some the info. But I had a question. How would you code a "turn off" and "turn on" switch and carry it to the next page. The pages you gave me make a lot of sense, yet I'm still totally lost. <?php session_start(); ..........then what? Link to comment https://forums.phpfreaks.com/topic/38414-solved-session-php/#findComment-184269 Share on other sites More sharing options...
Wireless102 Posted February 14, 2007 Share Posted February 14, 2007 at the top of each page of code put the session_start(); or session will not work, unless auto session start is set in the php.ini as long as you have the session_start(); the values that you store in the session will be available on each page. access the values with $name = $_SESSION['name']; Link to comment https://forums.phpfreaks.com/topic/38414-solved-session-php/#findComment-184271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.