在使用header之前不能有任何输出

解决方案 »

  1.   

    可以使用Javascript:window.open()与window.close()就可以随意关闭页面。
      

  2.   

    header("Location: destination.php\r\n");
      

  3.   

    有三种方式一、在php脚本中实现跳转
    header("location:url");
    注意需要把代码写在<??>中,这是php脚本。二、在html的<meta>头中向另外一个页面发送文件头
    <meta http-equiv=refresh content="0;URL=url">
    其中的0是0秒后跳转
    需要放在<??>外,因为那不是php代码,是html脚本三、用JavaScript
    <script language=javascript>
    location.href=url;
    </script>