title: How to loop through $_GET to get all the data
body: <p>I've a big problem:
  When someone selects multiple products, for example he selects 3 products, it goes into the shopping cart. When he sends the order (checkout) I only see the first product in my mail, not 3.</p>
  
  <p>This is because I have stated in function.js:</p>
  
  <pre><code>function fillInForm(){
  
      NumberOrdered = 0;
      NumberOrdered = readCookies("NumberOrdered");
  
      for (i = 1; i &lt;= NumberOrdered; i++){
          NewOrder = "Order" + i;
          thisCookie = "";
          thisCookie = readCookies(NewOrder);;
          fields = new Array();
          fields = thisCookie.split("|");
          document.write("&lt;input type=hidden name=\"Product ID " + i + "\" value=\"" + fields[0] + "\"&gt;");
          document.write("&lt;input type=hidden name=\"Brand " + i + "\" value=\"" + fields[1] + "\"&gt;");
          document.write("&lt;input type=hidden name=\"Model " + i + "\" value=\"" + fields[2] + "\"&gt;");
          document.write("&lt;input type=hidden name=\"Price " + i + "\" value=\"" + fields[3] + "\"&gt;");
          document.write("&lt;input type=hidden name=\"Amount products " + i + "\" value=\"" + fields[4] + "\"&gt;");
          document.write("&lt;input type=hidden name=\"Total cost " + i + "\" value=\"" + fields[3] * fields[4] + "\"&gt;");
          document.write("&lt;input type=hidden name=\" " + "\" value=\"" + "\"&gt;");
  
      }
  }
  </code></pre>
  
  <p>when I use var_dump($_GET); it shows me everything, so the three products it shows me have 
  something like</p>
  
  <pre><code>["Brand_1"]=&gt;
  ["Brand_2"]=&gt;
  ["Brand_3"]=&gt;
  </code></pre>
  
  <p>In mail.php where the information is send to I have:</p>
  
  <pre><code>$brand = $_GET["Brand_1"]; (&lt;&lt;WITH 1, one) 
  </code></pre>
  
  <p>because </p>
  
  <pre><code>$brand = $_GET["Brand_i"]; (&lt;&lt;WITH i) does not work.
  </code></pre>
  
  <p>But in theory I need </p>
  
  <pre><code>$brand = $_GET["Brand_i"] (&lt;&lt;WITH i)to get all the products............
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>mail.php</p>
  
  <pre><code>$productid = $_GET["Product_ID_1"];
  $brand = $_GET["Brand_1"];
  $model = $_GET["Model_1"];
  $price = $_GET["Price_1"];
  $amount = $_GET["Amount_products_1"];
  $totalcost = $_GET["Total_cost_1"];
  
  $message .= 'Your order information: ' . '&lt;br /&gt;';
  $message .= 'Product ID: ' . $productid . "&lt;br /&gt;" .
              'Brand: '. $brand . "&lt;br /&gt;" .
              'Model: ' . $model . "&lt;br /&gt;" .
              'Price per item: ' . $price . "&lt;br /&gt;" .
              'Amount of item: ' . $amount . "&lt;br /&gt;" .
              'Total cost: ' . $totalcost . "&lt;br /&gt;" .
              'Order date and time: ' . $date;
  $message .= '&lt;/body&gt;&lt;/html&gt;';
  </code></pre>