elmas156 Posted August 28, 2008 Share Posted August 28, 2008 Just a quick question... When passing an "email" variable from page 1 to page 2 using a session I put the code: $_SESSION['email'] = $email; on page 1 to send the variable and $email = $_SESSION['email']; on page 2 to make it into a variable again... The question is if I want to pass the same variable from page 2 to page 3 do I have to put $_SESSION['email'] = $email; on page 2 as well or can I just put $_SESSION['email'] = $email; on page 3 if the session has not ended yet? Link to comment https://forums.phpfreaks.com/topic/121633-variables-passed-through-sessions/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 28, 2008 Share Posted August 28, 2008 $_SESSION['email'] is a perfectly fine variable name. Once you put something in it, just use $_SESSION['email'] on any page where you have resumed the session using a session_start(); statement. Link to comment https://forums.phpfreaks.com/topic/121633-variables-passed-through-sessions/#findComment-627450 Share on other sites More sharing options...
elmas156 Posted August 28, 2008 Author Share Posted August 28, 2008 You mean I don't have to do all that work over and over again!!!? Man, I'm loving php more every day. Thanks for the info. Link to comment https://forums.phpfreaks.com/topic/121633-variables-passed-through-sessions/#findComment-627453 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.