I am not able to get my email input even after defining my sessions, please look below:
I have two scripts: The first is is to show the declaration of the session, while the second is to display the session's value:
First Script:sessionTest1.php
<?php
session_start();
?>
<html>
<head><title>Testing Sessions page 1</title></head>
<body>
<?php
$_SESSION['session_var'] = "testing";
@$_SESSION['session_var2'] = $_POST['email'];
echo "This is a test of the sessions feature.
<form action='sessionTest2.php' method='POST'>
<input type='hidden' name='form_var'
value='testing'>
<input type='text' name='email'>
<input type='submit' value='go to next page'>
</form>";
?>
</body></html>
Second Script:sessionTest2.php
<?php
session_start();
?>
<html>
<head><title>Testing Sessions page 2</title></head>
<body>
<?php
echo "session_var = {$_SESSION['session_var']}<br>\n";
echo "session_var2 = {$_SESSION['session_var2']}<br>\n";
echo "form_var = {$_POST['form_var']}<br>\n";
?>
</body></html>
Please what could be possibly wrong? or what should i do to obtain the entered value for the email and then be able to pass it along to as many pages as possible?