簡介:這是gb2312的php檔案轉換為utf-8格式後的一個錯誤的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=324443' scrolling='no'>
GB2312的php檔案轉換為UTF-8格式後,php程式運行時就會出現header已發送這樣的錯誤提示(試圖開啟session的時候)。
錯誤如下:
代碼:
Warning: Cannot modify header information - headers already sent by (output started at /home/yoyo/public_html/blog/index.php:1) in /home/yoyo/public_html/blog/global.php on line 11 ? Warning: Cannot modify header information - headers already sent by (output started at /home/yoyo/public_html/blog/index.php:1) in /home/yoyo/public_html/blog/global.php on line 35 |
這樣的錯誤通常是在開啟session之前頁面已經有輸出時出現,在IE下面看,並沒有輸出,可是在firefox下面看,在正式頁面輸出前,有一個位元組的亂碼。這個亂碼就是造成錯誤的原因(它在session之前就輸出了)。
解決的方法:找到你有出錯提示的檔案,下載下來,用編輯器(推薦用最新版的editplus)開啟,拷貝代碼,刪除這個檔案,重建一個新檔案,複製剛才的代碼進去,存檔案的時候,一定要存成UTF-8的,上傳覆蓋原檔案,應該就好了。
“gb2312的php檔案轉換為utf-8格式後的一個錯誤”的更多相關文章 》
愛J2EE關注Java邁克爾傑克遜視頻站JSON線上工具
http://biancheng.dnbcw.info/php/324443.html pageNo:14