This is my first time trying to work with php, I'm trying to store a user input into as session variable and pass it to another page which will then store it in a database. However my passed variables do not show up in the database. Any help is appreciated!
Here's where I get the variable values :
<form action ="csitProjectFunctionalityRegisterComplete.php">First name:<br>
<input id="fName" type="text" name="firstname" value="">
<br>
Last name:<br>
<input id="lName" type="text" name="lastname" value="">
<br>
Email:
<br>
<input id="email1" type="text" name="email" value="">
<br>
Username:
<br>
<input id="username1" type="text" name="username" value="">
<br>
Password:
<br>
<input id="password1" type="text" name="password" value="">
<br>
Re-enter Password:
<br>
<input id="password2" type="text" name="password" value="">
<br>
<br>
<input type="submit" class="btn btn-default btn-custom1">
</form>
Trying to set them as session variables:
$_SESSION['FName'] = $_POST['fName'];
$_SESSION['LName'] = $_POST['lName'];
$_SESSION['UName'] = $_POST['username1'];
$_SESSION['E_Mail'] = $_POST['email1'];
$_SESSION['PWord1'] = $_POST['password1'];
$_SESSION['PWord2'] = $_POST['password2'];
receiving:
$FNameC = $_SESSION['FName'];
$LNameC = $_SESSION['LName'];
$UNameC = $_SESSION['UName1'];
$E_MailC = $_SESSION['E_Mail'];
$PWord1C = $_SESSION['PWord1'];
$PWord2C = $_SESSION['PWord2'];
$User_ID = rand(1, 99999);
trying to send to database:
$sql = "INSERT INTO tempUsers (FirstName, LastName, Email, UserName, userID, Password)
VALUES ('$FNameC', '$LNameC', '$E_MailC', '$UNameC', '$User_IDC', '$PWord2C')";
EDIT: Again, I'm new to php, so perhaps I just don't understand it correctly, but this doesn't seem like a duplicate of that question to me. That seems to address checking if the variable is null, whereas I know the variable shouldn't be null, but for some reason between one page and the other it becomes null