setcookie("thisusername",$username);在我这里从来就没有用过—____—
我一直都得用setcookie("thisusername",$username,null,"/");的写法才生效。我也不清楚。

解决方案 »

  1.   

    setcookie("thisusername",$username,null,"/");效果一样的。
    郁闷~
      

  2.   

    注意你的PHP.INI 里。关于 cookie_path 是否有效。
      

  3.   

    我刚才改用SESSION就可以了。
    COOKIE就不行。
      

  4.   

    configure problem in php.ini
      

  5.   

    你根据什么说“setcookie没用了”???
      

  6.   

    session有用,99%~=cookie有用- -
      

  7.   

    下面的代码可以在index.php输出$thisusername的值:
    session_start();
    $thisusername = "123"; 
    session_register("thisusername"); 
    Header("Location:index.php");但是用下面的代码在index.php输出$thisusername的值为空:
    $thisusername = "123"; 
    setcookie("thisusername",$username);究竟是为什么?
      

  8.   

    Logon.php就是下面的代码了:
    -----------------------------------------------------------------
    下面的代码可以在index.php输出$thisusername的值:
    session_start();
    $thisusername = "123"; 
    session_register("thisusername"); 
    Header("Location:index.php");但是用下面的代码在index.php输出$thisusername的值为空:
    $thisusername = "123"; 
    setcookie("thisusername",$username);
    Header("Location:index.php");
    -------------------------------------------------------------index.php就是下面的代码:
    <?
    //用SESSION可以得到$thisuername的值,但是用setcookie时就没有输出内容.
    echo $thisusername;
    ?>
      

  9.   

    index.php就是下面的代码:
    <?
    //用SESSION可以得到$thisuername的值,但是用setcookie时就没有输出内容.
    echo $thisusername;
    ?>
    就这个代码?在用session时可以得到正确值???
      

  10.   

    对呀!用SESSION可以输出“123”
    用setcookie就什么都没有!