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 function didn't seem to work.
Help would be appreciated