title: PHP - Retrieve via $_POST the hidden input's value between several others
body: <p>I have a <code>table</code> that is in a <code>foreach</code> loop, and every iteration the hidden <code>input</code> receives the ID from the database. My table has in each column an <code>input</code> field because I'd like to edit the data from the database right in the table, and to make it happen I had to put a submit <code>button</code> that when clicked retrieves the ID from the hidden <code>input</code> into another file that then does the operation.</p>
  
  <pre><code>&lt;form action="../php/Operations.php" method="post"&gt;
  //...
  &lt;?php foreach ($Service-&gt;select() as $col) { ?&gt;
  &lt;input type="hidden" value="&lt;?php echo $col["id"]; ?&gt;" name="id"/&gt;
  //...
  </code></pre>
  
  <p>The problem is that the <code>$_POST</code> value is always the very first from the table, because there are <em>n</em> hidden <code>input</code> with the same name.</p>
  
  <p>I'd like to know if there is a way to retrieve the hidden <code>input</code>'s value from the clicked row, having in mind I'm not using <code>$_GET</code>, but a submit <code>button</code>,</p>
  
  <p><code>&lt;button type="submit" name="submit" value="update" class="btn_action"&gt;Editar&lt;/button&gt;</code> </p>
  
  <p>that when clicked is supose to execute the code I wrote:</p>
  
  <pre><code>switch($_REQUEST["submit"]) {
      case "update":
          $ServiceDatabase-&gt;update($_POST["id"]);
          break;
  //...
  </code></pre>
  
  <p>Thank you.</p>