On my first page: page1.php I have an input where you type your desired name which I then want to be carried over to more than one page, so far I can get it to page2.php but on page3.php the code fails here is my code
page1.php:
<form action="page2.php" method="post">
Name: <input type="text" name="username" />
<input type="submit" name="submit" value="Submit" />
\
page2.php: (after 5 seconds the page redirects to page3.php)
<?php
echo $_SESSION['username'] = $_POST['username'];
?>
<form action="page3.php" method="post">
<input type="hidden" name="username" />
page3.php:
<?php
echo $_SESSION['username'] = $_POST['username'];
?>
These lines work on page2.php but not here which is what I can't seem to fix