我有一個文件在我的服務器的根目錄:頭重定向到位置不起作用
<?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文件錯誤的地方,或者爲什麼會這樣?
的<?php ...
之前刪除任何和所有的空格和閱讀How to fix "Headers already sent" error in PHP
沒必要閱讀只是刪除空格。多謝,夥計! – patriques
你忘了標題的名字:
header("Location: http://example.com");
你看到任何錯誤(開機錯誤報告後)?你能否定義「不起作用」 – Lix
@Lix它不重定向到google.com – patriques
沒有即時通訊沒有看到任何錯誤。 – patriques