Tuesday, March 9, 2010

php header cannot be rewrite

我用php的header()函式來轉換網頁,
之後就出現
Cannot modify header information - headers already sent by
這串文字,
我看書上寫是因 為沒加session_start的標檔,
加上去後也還是一樣的情況,
在網路上找到一些方法,
有人說"header函式前不能有 任何輸出
"而且"BOM"也可能是原因之一,
後來我發現這個方法也不行,
後來在別人 的BLOG找到,
http://jmizl.pixnet.net/blog/post/13747457
Step1. 開啟 PHP 資料夾內的 php.ini 檔。
Step2. 找到『output_buffering』這行,將預設的『Off』改為『On』,並重啟 Apache services 即可。
這樣就可以 了,
要記得O要大寫的。

No comments: