I'm trying PHP session where the user will input an Email in page 1 . After they've entered , they'll be redirect to page 2 with the email displayed as the user.
Here's my page 1 PHP code looks like :
<?php
session_start();
$_SESSION['email']= isset($_POST['email']) ;
if(isset($_POST['submit'])){
header('Location: http://localhost/page2');
}
?>
<form method="post" action="">
Email: <input type="text" name="email" value=""/> <br/><br/>
<input type="submit" name="submit"/> </form>
Page 2 :
<?php
session_start();
$email = (isset($_SESSION['email']));
echo $_SESSION['email'];
//print_r($_SESSION);
//var_dump($email);
?>
Problem:
The problem is , when I entered any random emails , it shows number 1 in page 2 when I echoed it.