Headers already sent? But how? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Headers already sent? But how? (/showthread.php?tid=32408) |
Headers already sent? But how? - El Forum - 07-22-2010 [eluser]parham90[/eluser] Hi, Here I am again, with another mystery! First of all, I am not setting any headers at all. I am just adding a value to the database. However, this is the error I get: A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\system\application\controllers\welcome.php:1) Filename: codeigniter/Common.php Line Number: 360 Here is the welcome.php: Code: <?php And here is views/index/test.php: Code: <html> This code was primarily to test adding of unicode values (Farsi in this instance) to Postgre. Any ideas? Thanks a bunch! Headers already sent? But how? - El Forum - 07-22-2010 [eluser]danmontgomery[/eluser] Whitespace before opening <?php tag or utf-8 file saved with BOM header, see: http://ellislab.com/forums/viewthread/158276/ (among others, searching is your friend) Headers already sent? But how? - El Forum - 07-22-2010 [eluser]parham90[/eluser] Hi there, Thanks. But wouldn't the lack of UTF-8 BOM make the Farsi characters appear as jibberish? Headers already sent? But how? - El Forum - 07-22-2010 [eluser]parham90[/eluser] In fact, I tried now. I just saved the file normally, and didn't export it in UTF-8. What I suspected happened; all you see in the database are question marks. Headers already sent? But how? - El Forum - 07-22-2010 [eluser]WanWizard[/eluser] In my editor (Geany on Linux) the option "Write Unicode BOM" is completely seperate from the encoding I select. Just copied the Farsi text from this site, saved it as a UTF-8 file (no BOM), viewed it in the browser (no problem, and shows encoding UTF-8), and opened it again (still ok). Maybe it's time for a better editor? Headers already sent? But how? - El Forum - 07-22-2010 [eluser]parham90[/eluser] Thanks a lot! Now I know it's an editor issue. |