title: What am I doing wrong with this phone SESSION I'm trying to print to screen?
body: <p>I am testing a SESSION where the three prior pages prints to the last page. But I'm have trouble getting it to work. Everything goes well until the last page. Here is the code:</p>
  
  <pre><code>&lt;?php
  session_start();
  
  if (isset($_POST['submit'])) { 
  $_SESSION['name'] = $_POST ['name'];
  $_SESSION['email'] = $_POST ['email'];
  $_SESSION['age'] = $_POST ['age'];
  
  echo $_SESSION['name'];
  echo $_SESSION['email'];
  echo $_SESSION['age'];
  }
  ?&gt;
  </code></pre>
  
  <p>I'm getting a blank or a index error for the session variable. Can anyone help with the correct way to print user inputted session data?</p>
  
  <p>These are the 1st, 2nd and 3rd pages:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;phpsession&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="POST" action="test_2_page_1.php"&gt;
  &lt;input type="text" name="name" placeholder="enter name"&gt;&lt;/input&gt;
  &lt;input type="submit"&gt; next&lt;/input&gt;
  &lt;/form&gt;
  &lt;?php
  //Set session variables
  if (isset($_POST['submit'])) { 
  $_SESSION['name'] = $_POST ['name'];
  }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;?php
  session_start();
  if (isset($_POST['submit'])) { 
  $_SESSION['name'] = $_POST ['name'];
  $_SESSION['email'] = $_POST ['email'];
  }
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;phpsession&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="POST" action="test_2_page_2.php"&gt;
  &lt;input type="text" name="email" placeholder="enter email"&gt;&lt;/input&gt;
  &lt;input type="submit"&gt; next&lt;/input&gt;
  &lt;/form&gt;
  &lt;?php
  // Set session variables
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;?php
  session_start();
  if (isset($_POST['submit'])) { 
  $_SESSION['name'] = $_POST ['name'];
  $_SESSION['email'] = $_POST ['email'];
  $_SESSION['age'] = $_POST ['age'];
  }
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;phpsession&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="POST" action="post_test.php"&gt;
  &lt;input type="text" name="age" placeholder="enter age"&gt;&lt;/input&gt;
  &lt;input type="submit"&gt; next&lt;/input&gt;
  &lt;/form&gt;
  &lt;?php
  // Set session variables
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>