JamesKoash Posted August 27, 2013 Share Posted August 27, 2013 (edited) Hi there, I'm trying to put together a multi-page form, which uses PHP sessions to store data, but am having trouble getting it working. Here is my code for the first page. (I haven't yet added any form validation or anything). session_start(); if(isset($POST['name'])) $_SESSION['name'] = $POST['name']; else $_SESSION['name'] = ""; if(isset($POST['email'])) $_SESSION['email'] = $POST['email']; else $_SESSION['email'] = ""; if(isset($POST['businessname'])) $_SESSION['businessname'] = $POST['businessname']; else $_SESSION['businessname'] = ""; if(isset($POST['job'])) $_SESSION['job'] = $POST['job']; else $_SESSION['job'] = ""; I've even tried them all with two sets of equals symbols, as that seems to be the error I made last time I posted code on here, but that hasn't fixed it this time. In fact, it seemed to throw up more errors. The page is titled page_1.php and I'm using a form tag with method="post" and action="page_1.php" to collect the data. I tried testing whether the sessions were working by creating a variable called $name, which I stated was equal $_SESSION['name'], but printing this variable didn't seem to work. Help would be appreciated Edited August 27, 2013 by JamesKoash Quote Link to comment https://forums.phpfreaks.com/topic/281594-php-sessions-query/ Share on other sites More sharing options...
Solution PaulRyan Posted August 27, 2013 Solution Share Posted August 27, 2013 It is $_POST not $POST Quote Link to comment https://forums.phpfreaks.com/topic/281594-php-sessions-query/#findComment-1446958 Share on other sites More sharing options...
JamesKoash Posted August 27, 2013 Author Share Posted August 27, 2013 It is $_POST not $POST Can't believe I made such a silly mistake. Haha. Thanks for correcting me Quote Link to comment https://forums.phpfreaks.com/topic/281594-php-sessions-query/#findComment-1446964 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.