To pass variables (username and email) from page1.php to page2.php using form:
Code for page1.php
<form method=post action=page2.php>
<input type=text name=username><br>
<input type=text name=email>
<input type=submit name=submit value="Pass variables to the next page">
</form>
code for page2.php to display the variables
<?
echo "The entered username is: $username, and the email: $email";
//or
echo "The entered username is: $_POST[username], and the email: $_POST[email]";
?>
To further pass the variables to other pages, form is not convenient. You should use session. Modify page2.php to make variables available to any page:
<?
session_start();
$_SESSION[username]=$username;
$_SESSION[email]=$email;
/* or
$_SESSION[username]=$_POST[username];
$_SESSION[email]=$_POST[email];
*/
echo "The entered username is: $username, and the email: $email";
?>
To access variables stored in the session (page3.php):
<?
session_start();
echo $_SESSION[username];
echo "<br>";
echo $_SESSION[email];
?>
Hope these examples get you started.