php会话无法正常工作

时间:2014-09-28 21:38:23

标签: php

我有一个带有不同用户按钮的while循环,点击后他们用相应的用户名设置会话,这就是我在while循环中的内容:

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>'; 

这里的问题是它只设置第一个用户的会话,即使我点击最后一个用户 这里是我正在做什么http://i.imgur.com/cRu3mbV.png

的预览

0 个答案:

没有答案
相关问题