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 Quote Link to comment 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 ' Quote Link to comment 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 ' Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
aeboi80 Posted October 12, 2010 Author Share Posted October 12, 2010 I fixed it myself Quote Link to comment 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.