PHP/Javascript: Same input "id" in while
<p>In my friends page, when you accept a user, it sends a ajax call:</p>

<pre><code>function MeYouFriendNB(confirm){
 var c = confirm ? 'confirm' : 'ignore';
var fID = $('.fID').val();

    $.ajax({ 
       type: "POST",
       url: "misc/AddFriend.php",
    data: {
    mode: 'ajax',
        friend: c,
    uID : $('#uID'+fID).val(),
    fID : $('#fID'+fID).val(),
        bID : $('#bID'+fID).val()
    },
       success: function(msg){
$('#friend'+fID).slideUp('slow');
$('#Friendlist').prepend(msg);
 $('#theNewFriend').slideDown('slow');
        }
     });
}
</code></pre>

<p>On each friend request, there's a link to the function:</p>

<pre><code>&lt;?php
while($showW = mysql_fetch_array($friendsWaiting)){
echo "&lt;div id='friend".$showW['id']."' style='position: relative; background: #3a5f6e;'&gt;";
?&gt;
        &lt;input type="hidden" name="fID" class="fID" value="&lt;? echo $sInfo["id"]; ?&gt;"&gt;
    &lt;input type="hidden" name="uID" id="uID&lt;? echo $showW["id"]; ?&gt;" value="&lt;? echo $sid; ?&gt;"&gt;
&lt;input type="hidden" name="fID" id="fID&lt;? echo $showW["id"]; ?&gt;" value="&lt;? echo $showW["id"]; ?&gt;"&gt;
&lt;input type="hidden" name="bID" id="bID&lt;? echo $showW["id"]; ?&gt;" value="&lt;? echo $showW["bID"]; ?&gt;"&gt;

    &lt;?php
echo "&lt;div style='position: absolute; top: 15px; right: 105px;'&gt;
&lt;a href='javascript:void(0);' onclick='MeYouFriendNB(true);' style=' margin-right: 45px; color: #FFF;'&gt;Bekräfta&lt;/a&gt;
 &lt;a href='javascript:void(0);' onclick='MeYouFriendNB(false);' style='color: #ccc;'&gt;Ignorera&lt;/a&gt;&lt;/div&gt;";
}
?&gt;
</code></pre>

<p>But everytime it sends the ajax call, it gives same fID, bID and uID, to every friendrequest. So e.g if i have 5 friend request, them all have same fID, uID and bID.</p>

<p>As you can see i tried to make the bID and uID and fID´s id unique by adding <code>&lt;? echo $showW["id"]; ?&gt;</code> to the id´s fID, uID and bID, and in the function, i made a var fID that checks class .fID for the id, that they all have... but this didnt work out, it still send the same ids to the ajax call</p>

<p>Hope you can help me</p>
