两者实质是一样的。
你加上 ob_start() 就OK了。
没有啥不爽的。

解决方案 »

  1.   

    header比response.redirect功能要强呀,要么你自己写个函数包装一下咯
      

  2.   

    echo "<script>window.location =".$url.";</script>"; 

    echo "<meta http-equiv=\"refresh\" content=\"0;URL=".$url."\">";
      

  3.   

    楼上的..
    那样写比用header麻烦多了
      

  4.   

    楼主,请你告诉我,header("location")和redirect的区别是什么???
      

  5.   

    header("location:$url")前面不能有输出,有时候不方便啊echo "<script>window.location =".$url.";</script>"; 
    这样也没什么不好嘛
      

  6.   

    echo "<meta http-equiv=refresh content='0; url=http://www.phpx.com'>";
      

  7.   

    if(condition){
      header("location:url1");
    }else{
      header("location:url2");
    }
    能这样做?