I am new to PHP and sessions.
I am currently creating a twelve page form and I need to use a session fo every page to keep the user input intact, which will later be emailed to the client.
The user inputs a variable on page one I, have this code
<? session_start();
FORM METHOD="POST" ACTION="page2.php">
Enter your Name: <input type="text" name="name">
<input type="SUBMIT" value="Submit">
?>
Then on page two I register the variable with this code:
<?session_start();
// Get the user's input from the form
$name = $_POST['name'];
// Create a new Session Value
session_register('name');
// Register the input with the value
$_SESSION['name'] = $name;
?>
Then page two will display another html form will be sent to page three for processing. . . . etc.
I just want to make sure I am doing this correctly and not making any mistakes or coding improperly.
Any input is appreciated.
Thanks