title: How to get values of duplicate parameters from URL in php?
body: <p>How can i use $_GET to return the values from the URL bar?</p>
  
  <p>Checkboxes are ticked in a form, this is the part that concerns the $_GET variable (I have cut some of it out):</p>
  
  <pre><code>&lt;form action= "&lt;?php echo $_SERVER['PHP_SELF'];?&gt;" method="get"&gt;
  echo "&lt;table border='1'&gt;";
  // Start of the table
  
  while($row = mysql_fetch_array($result))
  // The while loop enables each of the stock codes to have
  // a separate page within the table, based on the stock code.
  {
  echo "&lt;tr&gt;";
  // Starts the table row.
  
  echo "&lt;td&gt;Stock Code: " . $row['stock_code'] . "
  &lt;/br&gt; Stock Name: " . $row['stock_name'] . "&lt;/td&gt;";
  $num = 0;
  echo "&lt;td&gt;&lt;input type='checkbox' id='select" . $num . "' name='select" . $num . "' value=".$row['stock_code']."&gt;&lt;/input&gt;&lt;/td&gt;";
  $num = $num+1; }
  </code></pre>
  
  <p>When I click submit, the stock codes go into the URL bar like this:</p>
  
  <pre><code>submitcheckbox.php?select72=DFC107&amp;select74=DFC120&amp;select79=DFC123
  </code></pre>
  
  <p>I need it to loop through the $_GET values, check which boxes are set and then update the database if they have been checked with a marker.</p>
  
  <p>I am looking at using a while loop, using isset to check whether the checkboxes have been selected:</p>
  
  <pre><code>$numrows = count($row);
  $i=0;
  while ($i&lt;=$numrows){
  if (isset ($_GET['select.i']));
  echo $_GET['select.i'];
  $i++;
  
  $save = $_GET['select.i'];
  echo $save;
  </code></pre>
  
  <p>Haven't been very successful so far... wondering if there may be a better to way to do it like using arrays?</p>