title: pass post value from one php to another php page
body: <p>I have 2 php scripts one that takes the values from a form on an html page and just return them to the user so he can check they are correct i then want to allow him to confirm then by pressing a submit button, the values will then be written on a txt file.
  Here is my code that i have so far, the script return that the values are being written on the file but there is nothing in the file></p>
  
  <p>code:
  fist php:</p>
  
  <pre><code>$surname = $_POST['surname'];
  $lastname = $_POST['lastname'];
  $mail = $_POST['mail'];
  &lt;div id="oneConatiner"&gt;
      &lt;h1&gt;Please confirm the details of your order:&lt;/h1&gt;
      &lt;div align="left" id='php'&gt;
      &lt;form name="info" method="post" action="confirmation.php"&gt;
          &lt;p&gt;Your surname is: &lt;?php echo $surname . "&lt;p&gt;"; ?&gt;
          &lt;p&gt;Your lastname is: &lt;?php echo $lastname . "&lt;/p&gt;&lt;/div&gt;"; ?&gt;
          &lt;p&gt;Your email is: &lt;?php echo $mail . "&lt;p&gt;"; ?&gt;
          &lt;p&gt;&lt;input type="submit" name="Submit" value="Confirm" /&gt;&lt;/p&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Second php:</p>
  
  <pre><code>&lt;?php
      $surname = $_POST['surname'];
      $lastname = $_POST['lastname'];
      $mail = $_POST['mail'];
      $page = ceil($quantity / 10);
      $data = "$surname,$lastname,$mail\r\n";
      $fh = fopen("user.txt", "a");    
      fwrite($fh, $data);
      fclose($fh); 
      if (fwrite == FALSE){
          echo "fail";        
      } else {
          echo "successful";
      }        
  ?&gt;  
  </code></pre>