title: Getting the wrong value with type="hidden"
body: <p>In my application I'm trying to send an invitation for joining a group. Therefore, I want to get <code>user_id</code> of the person you are inviting. At this moment, I get a value but it's always the <code>user_id</code> of the last person of the results, not the person that I choose. </p>
  
  <p>PRINT OUT</p>
  
  <pre><code>   &lt;div id="InviteGroupMembers"&gt;
              &lt;form action="&lt;?php echo $_SERVER['PHP_SELF'] . "?group_id=" .$group_id; ?&gt;" method="post"&gt;
                  &lt;div &gt;
                      &lt;input type="text" name="btnSearch" placeholder="Add people to group"/&gt;
                  &lt;/div&gt;
  
                  &lt;div&gt;
                      &lt;button type="submit"  name=""&gt;Add&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;/form&gt;
  
              &lt;form action="&lt;?php echo $_SERVER['PHP_SELF'] . "?group_id=" .$group_id; ?&gt;" method="post"&gt;
                      &lt;?php
                      if (is_object($searchresult))
                          while ($row = $searchresult -&gt; fetch_array()) {
                              echo "&lt;div&gt;&lt;p class='searchresults'&gt;&lt;img src='uploads/" . $row['avatar'] . " " . "' alt='' /&gt;" .  $row['surname'] . " " . $row['name'] . " " . "&lt;input type='submit' name='btnAddMember'class='addFriendToGroup' value='' /&gt;&lt;input type='hidden' name='user_id' value='" . $row['user_id'] . "'/&gt;&lt;/p&gt;&lt;/div&gt;"; }         
  
                      ?&gt;
                  &lt;/form&gt;
  
  
          &lt;/div&gt;
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>if (isset($_POST["btnSearch"])) {
      try {
          $searchinput = mysql_real_escape_string($_POST['btnSearch']);
          $searchresult = $user -&gt; Search($searchinput);
      } catch(exception $e) {
          $feedback = $e -&gt; getMessage("no results");
      }
  }
  
  if (isset($_POST["btnAddMember"])) {
      try{
          $group_receiver_id = mysql_real_escape_string($_POST['user_id']);
          var_dump($group_receiver_id);
      }
      catch(exception $e) {
          $feedback = $e -&gt; getMessage("no results");
      }
  
  }
  </code></pre>