我的服务器根目录中有一个文件:
<?php
header("Location: http://www.google.com/", true); //this does not work
//echo "Test"; //this is tested and works.
?>
我的 php.ini 文件是否在某处有误,或者为什么会这样?
我的服务器根目录中有一个文件:
<?php
header("Location: http://www.google.com/", true); //this does not work
//echo "Test"; //this is tested and works.
?>
我的 php.ini 文件是否在某处有误,或者为什么会这样?
您忘记了标题的名称:
header("Location: http://example.com");
删除之前的所有空格<?php ...
并阅读如何修复 PHP 中的“标头已发送”错误