aeboi80 Posted October 12, 2010 Share Posted October 12, 2010 I am having problems storing a $_POST variable from a form into a $_SESSION. When I go to the next page and echo out the $_SESSION variable its blank Page 1 code (page with self submitting form action) <?php session_start(); $email = $_POST['email]; $_SESSION['email'] = $email; ?> Page 2 (page which should be echoing out the value of the session variable) <?php session_start(); echo "Your Email Address which you submitted was: " . $_SESSION['email']; ?> When I echo that out on page 2 its blank Why is the variable value not carrying over to the 2nd page? Chad Link to comment https://forums.phpfreaks.com/topic/215674-storing-a-_post-in-a-_session-not-working/ Share on other sites More sharing options...
pengu Posted October 12, 2010 Share Posted October 12, 2010 Change $email = $_POST['email]; To $email = $_POST['email']; You forgot a ' Link to comment https://forums.phpfreaks.com/topic/215674-storing-a-_post-in-a-_session-not-working/#findComment-1121354 Share on other sites More sharing options...
aeboi80 Posted October 12, 2010 Author Share Posted October 12, 2010 Whoops that was just a typo when I was writing my post here. The actual code does have the ' Link to comment https://forums.phpfreaks.com/topic/215674-storing-a-_post-in-a-_session-not-working/#findComment-1121358 Share on other sites More sharing options...
Pikachu2000 Posted October 12, 2010 Share Posted October 12, 2010 Copy/paste the code. It's pointless trying to debug anything other than the actual code. Link to comment https://forums.phpfreaks.com/topic/215674-storing-a-_post-in-a-_session-not-working/#findComment-1121360 Share on other sites More sharing options...
aeboi80 Posted October 12, 2010 Author Share Posted October 12, 2010 I fixed it myself Link to comment https://forums.phpfreaks.com/topic/215674-storing-a-_post-in-a-_session-not-working/#findComment-1121362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.