真的,我现在在调试,是www.mos.net.cn

解决方案 »

  1.   

    我也很纳闷,而且让朋友测试的也是如此,我在退出文件:exit.php中加上了判断,提示没有退出,如下。setcookie('login','',time()-3600);
    setcookie('username','',time()-3600);
    if ($_COOKIE['login']==1) {
    message("没有退出成功!","/indexlogin.php");
    }
    else {
    message("你已经成功退出!","/indexlogin.php");
    }怎么回事?大家帮帮我呀!
      

  2.   

    后注册cookie变量一样,注销cookie变量要在下一次连接时才生效你在当前页进行判断是不行的
      

  3.   

    那我运行了exit.php,转向网站首页(内嵌了登录框),怎么还在线呢?
      

  4.   

    运行了exit.php,转向了首页,我手动刷新一次都不能不行,还是在线的。
      

  5.   

    我这样加了一句刷新一次的代码,还是没有注销cookie:
    setcookie('login','',time()-3600);
    setcookie('username','',time()-3600);if (!$act2) {
    echo"<script language=javascript>window.location='exit.php?act2=1'</script>";
    }if ($_COOKIE['login']==1) {
    message("没有退出成功!","/indexlogin.php");
    }
    else {
    message("你已经成功退出!","/indexlogin.php");
    }
      

  6.   

    indexlogin.php是首页内嵌的登录块(如www.mos.net.cn首页),在根目录下,可以用mouzhi用户名,nihao密码登录。
    indexlogin.php中的启用cookie的代码如下:
    <?
    include "admin/include/config.php";
    include "admin/include/function.php";
    if ($action=="login") {
    //判断
    $query="select passwd from member where username='$username'";
    $result=mysql_query($query);
    $arr=mysql_fetch_array($result);if ($userpwd<>$arr[passwd]) {
    setcookie('login','',time()-3600);
    setcookie('username','',time()-3600);
        message("输入有误,请先登录!","indexlogin.php");
        exit;
     } 
     else {
    //启用
    setcookie('login',1);//保存用户是否登陆
    setcookie('username',$username);//登陆用户名
     }
    }
    ?>登录成功后,就有一个“退出”的链接。退出是exit.php执行,放在根目录下的admin目录下。代码如下:
    <?
    include "include/config.php";
    include "include/function.php";
    setcookie('login','',time()-3600);
    setcookie('username','',time()-3600);if (!$act2) {
    echo"<script language=javascript>window.location='exit.php?act2=1'</script>";
    }if ($_COOKIE['login']==1) {
    message("没有退出成功!","/indexlogin.php");
    }
    else {
    message("你已经成功退出!","/indexlogin.php");
    }
    ?>
      

  7.   

    php+window xp+apache
            A)设置cookie:
            setcookie(“test“,“test“,null,“/“);        删除cookie:
            1.setcookie(“test“,““);失败
            2.setcookie(“test“,““,null,“/“);成功        B)设置cookie:
            setcookie(“test“,“test“);        删除cookie:
            1.setcookie(“test“,““);成功
            2.setcookie(“test“,““,null,“/“);失败
      

  8.   

    你的exit.php和indexlogin.php不在同一个目录中呀
    设置cookie时要指定“路径”设置
    setcookie('login',1,0,'/');
    setcookie('username',$username,0,'/');
    删除
    setcookie('login','',0,'/');
    setcookie('username','',0,'/');