header("location: login.php");注意啊 冒号右面有个空格
还有啊 用header之前不能有任何html发送过去 包括不能有空行!!不能用
session

解决方案 »

  1.   

    ob_start();//放在开始
    $strheader="Location:login.php";
    header($strheader);
    ob_end_flush();//放在末尾
      

  2.   

    还是不行!下面是错误信息;Warning: Cannot add header information - headers already sent by (output started at /var/www/html/Classroom/mbq/register.php:3) in /var/www/html/Classroom/mbq/register.php on line 6
    谢谢大家帮忙!!
      

  3.   

    我是放在最前面的呀!前面不能有什么输出?那我想跳传的时候用什么?thank all!
      

  4.   

    <?
    ob_start();
    //...................
    $strheader="Location:login.php";
    header($strheader);
    //...................
    ob_end_flush();
    ?>
    这样不可能错误的前面不能有输出,包括空格空行