title: php mysql undefined index
body: <p>I have three php pages the first page is to enter user details in the fields the second page is to insert user details in the database the third page is to show the user details that have been sent to the database,</p>
  
  <p>everything work fine except in the third page the user details doest not appear and  I get this error messages:</p>
  
  <p>Notice: Undefined variable: user
  Notice: Undefined variable: email 
  Notice: Undefined variable: pass</p>
  
  <p>here is my code:</p>
  
  <p>first_page.php</p>
  
  <pre><code>&lt;form action="second_page.php" method="post" &gt;
  User Name:  
  &lt;input  type="text" name="username" &gt;
  User Email
  &lt;input  type="text" name="useremail" &gt;
  Password:  
  &lt;input  type="text" name="password" &gt;
  &lt;input type="submit"  name="submit" &gt;
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <p>second_page.php</p>
  
  <pre><code>if (isset($_POST['submit'])) 
  {
  $user= $_POST['username'];
  $email = $_POST['useremail'];
  $pass= $_POST['password']; 
  
  mysql_query("INSERT INTO table (username, useremail, password) VALUES  ('$user','$emai','$pass');
  header("location: third_page.php");
  exit;
  </code></pre>
  
  <hr>
  
  <p>third_page.php</p>
  
  <pre><code>$user= $_POST['username'];
  $email = $_POST['useremail'];
  $pass= $_POST['password']; 
  
  echo ' the user name: '.$user;
  echo ' the user email:.'$email;
  echo 'the user password:.'$pass;
  </code></pre>