在这个程序中,我正在制作一个标头设置为 google.co.in 的 PHP 文件。让我们看看代码
<?php
session_start();
$status=$_POST['input'];
    if (isset($status)) {
        header('Location: http://google.co.in/');
    } 
?>
我有另一个包含 javascript 的文件,让我们看看
<?php
session_start();
echo time();
?>
<html>
<head>
    <title>my app</title>
    <script type="text/javascript" src="jquery-2.0.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(this).mousemove(function(){
                $.post('logout.php',{input: 1});
                //window.location.href="logout.php"
            });
        });
    </script>
</head>
<body>
    <h2>we are on the main_session</h2>
</body>
</html>
现在的问题是,当我在本地主机上运行它时,我没有被重定向到 google.co.in,而是在 firebug 中显示 302 错误。但是,当我使用我在代码中注释的 window.location.href 语法时,我被重定向到 google.co.in。请告诉我这背后的问题是什么。