2010年1月18日 星期一

session_start()出現error

session_start();前面是不能帶有任何html輸出,這是大家都知道的。
但是重灌後突然發現之前的檔案有問題,出現

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at .... )
把檔案內文全刪只剩session_start();卻還是出現上述錯誤這就...
上網google後發現原來是UTF-8的BOM在做怪,只因重灌後直接用筆記本去修改結果造成寫入BOM。
用editplus->tools->preferences->files->utf-8 signature->always remove signature
再存一次檔就OK囉!

參考網頁:
http://blog.raienet.com/406
http://twpug.net/modules/smartfaq/faq.php?faqid=31
http://www.haixiait.com/article.asp?id=232
http://blog.planism.com/archives/2008/09/12/1701/%E7%94%A8-editplus-%E6%B6%88%E9%99%A4-utf-8-%E7%9A%84-bom