title: How do I pass data between pages in PHP?
body: <p>In a nutshell on "page1.php" I have a calculator that consists of an HTML form, and then the PHP code totals the input and displays the total price. Below the price, it also displays a link to "page2.php" which contains an HTML form where they can enter their contact information. Upon submitting the form the selections they made on "page1.php" in the pricing calculator as well as the contact info on "page2.php" are emailed to me, and they are redirected to the home page. </p>
  
  <p>In the email that is submitted to me, I receive the contact info from "page2.php", but I don't receive anything from "page1.php", so the variables are not getting correctly passed. In addition to the PHP on each page, I am using hidden values in an HTML form on "page2.php" to echo the data that was entered in the HTML form on "page1.php". I know that one of my issues is that I have a couple of <code>$_GET</code> fields when my form is "post".</p>
  
  <p>However when I change it so that everything is <code>$_POST</code>, the calculator no longer works. I tried to put this altogether with different snippets of code suggested by others.  The form on "page1.php" has 13 fields, named "one" - "thirteen".  $total display the values of 1-13. </p>
  
  <pre><code>&lt;?php
    $submit = $_GET['submit'];
    if($submit == "true")
    {
      $total = ($_POST['one'] + $_POST['two'] + $_POST['three'] + $_POST['four']  + 
      $_POST['five'] + $_POST['six'] + $_POST['seven'] + $_POST['eight']+ $_POST['nine'] + 
      $_POST['ten']+ $_POST['eleven'] + $_POST['twelve']+ $_POST['thirteen']); 
      echo  " Your Price is \$ " .number_format ($total, 2, '.', ','). "&lt;BR&gt;";
      echo ('"&gt;Get Your Project Started&lt;/a&gt;');
    }
  ?&gt;
  </code></pre>
  
  <p>The second form uses hidden values to echo the info from page1.php, and has three more fields named "name", "email" and "details".</p>
  
  <pre><code>&lt;?php
    $to = "jessica@designs.com";
    $message = "Pages:\t$_POST[one]\n";
    $message .= "Pages:\t$_POST[two]\n";
    $message .= "Pages:\t$_POST[three]\n";
    $message .= "Ecommerce:\t$_POST[four]\n";
    $message .= "No Ecommerce:\t$_POST[five]\n";
    $message .= "CMS:\t$_POST[six]\n";
    $message .= "No CMS:\t$_POST[seven]\n";
    $message .= "Audio or Video:\t$_POST[eight]\n";
    $message .= "Flash Intro:\t$_POST[nine]\n";
    $message .= "Image Gallery:\t$_POST[ten]\n";
    $message .= "Graphic Design or Logo:\t$_POST[eleven]\n";
    $message .= "Copy:\t$_POST[twelve]\n";
    $message .= "Images:\t$_POST[thirteen]\n";
    $message .= "Price Total:\t$_POST[total]\n";
    $message .= "Name:\t$_POST[name]\n";
    $message .= "Email:\t$_POST[email]\n";
    $message .= "\n";
    $message .= "\n";
    $message .= "Details:\t$_POST[details]\n";
    mail($to, $subject, $message, $headers) ;
    }
  ?&gt;
  </code></pre>
  
  <p>So what would be the correct PHP to put on "page1.php" and "page2.php"? Sorry the code is such a mess, if anyone could point me in the right direction, that would be great.</p>