还要指明目录名
header("location:http://(localhost)/(dirname)/index.php");

解决方案 »

  1.   

    其实用JS
    <script>...
    location="(dirname)/index.php";
    </script>
      

  2.   

    我觉得直接 includes(index.php) , 比较好。 不需要再与客户端交互,直接请求。
      

  3.   

    header("Location: http://" . $_SERVER['HTTP_HOST']
                          . dirname($_SERVER['PHP_SELF'])
                          . "/index.php");
      

  4.   

    $db=mysql_connect("localhost","admin");还差数据库服务器密码参数吧