This question already has an answer here:
After hours of searching, i cant solve my Problem. All other Answers i found is just on the first page an form an not on other pages, dont work for me or explain it correctly. i think my code is correct but its shows like $email = $_SESSION['email'];
is wrong or the code on the page before?
I want save the Input data from an form on Multiple Pages. i have 3 pages where the first two pages had an Form. The Problem i cant echo
the email
value from first page on the 3 Page.
Page 1:
<form class="" method="post" action="page2.php">
<input type="text" id="email" name="email" placeholder="email" />
<input type="submit" value="Next >" />
</form>
Page 2:
<?php
session_start();
$_SESSION['email'] = $_POST['email'];
include("config.php");
?>
.............
<form class="" method="post" action="page2.php">
<input type="text" id="password" name="password" placeholder="password" />
<input type="submit" value="Next >" />
</form>
Page 3:
<?php
session_start();
$_SESSION['password'] = $_POST['password'];
$email = $_SESSION['email'];
include("config.php");
?>.
..............
<?php
echo $_POST["email"];
?>
Whats wrong with my Session code? Error on 3 Page is: Undefined index: email
</div>