i have a while loop with buttons with different users , that when clicked they set a session with the respective username, this is what i have inside the while loop:
echo'<form method="POST">
<button name="user" class="usr-frmm-zone-msg" style="">
<div class="wrp1" style="width:100% auto; height:50px; margin-top:8px; margin-left:10px; overflow:hidden; float:left;">
<img src="'.$ff['avatar'].'" width="30px" style="border-radius:50%; margin-top:9px;" height="30px">
</div>
<div class="wrp1_useri">
<p style="font-weight:bold; color:#777777; margin-top:10px;">
';
echo''.$followed.' ('.$row.')';
echo'</p>
</div>
</button>';
if(isset($_POST['user']))
{
unset($_SESSION['userchat']);
$_SESSION['userchat'] = $followed;
echo '<meta http-equiv="refresh" content="0">';
}
echo' </form>';
The problem here is that it sets the session only of the first user, even if i click on the last here is a preview of what im doing http://i.imgur.com/cRu3mbV.png