header() 前面不能有任何实际输出的,包括HTML标记。页面上只保留<?
header("Location:index.php");
?> 就好

解决方案 »

  1.   

    很简单,header()前面不能有输出,前面那些HTML视为输出~~最后,你如果是要拿header()跳转,保留php代码就可以了,要HTML代码干嘛?
      

  2.   

    这样就可以
    <?
    header("Location:index.php");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档 </title>
    </head>
    <body>
    </body>
    </html>