I know this has been asked many, many, many times; however, the various things I have seen and tried have not worked.
All I want to do is pass data from one page to the next, so I can use the user's email to do various Database things.
Here's my login.php file (abridged, only showing the login stuff) :
<?php
session_start();
ini_set("display_errors", "1");
$user_email = $_POST['user_email'];
$_SESSION['user_email'] = $user_email;
$password = $_POST['user_password'];
//DB stuff
if ($num_results == 1) {
header('Location: nextPage.html');
exit;
}
else {
echo "<p> Username or Password is incorrect! </p>";
}
?>
Here is my next page html file:
<?php
session_start();
ini_set("display_errors", "1");
$email = $_SESSION['user_email'];
echo $email;
?>
<html>
<head>
<title> next page </title>
</head>
<body>
You have logged in!
</body>
</html>
Whenever I try to echo the email it is blank, and when I test for it, it tells me that it is empty.
Any advice would be helpful, thanks so much!!