![]() |
Cannot modify header information - headers already sent by...? - 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: Cannot modify header information - headers already sent by...? (/showthread.php?tid=34315) |
Cannot modify header information - headers already sent by...? - El Forum - 09-25-2010 [eluser]anna16[/eluser] Hi guys How do i fix this error below? http://www.coder9.com/ci/crud.php/welcome/contactus This is the controller welcome.php Code: <?php This is the model below mcontacts.php Code: <?php I hope someone can give me good advice for this. Thank you in advanced. Cannot modify header information - headers already sent by...? - El Forum - 09-25-2010 [eluser]Developer13[/eluser] Check your mcontacts.php file and make sure you don't have any extra spaces or linebreaks or anything after the PHP closing tag. The closing tag should be the very last thing in the file. Cannot modify header information - headers already sent by...? - El Forum - 09-25-2010 [eluser]Vega[/eluser] I don't think that you should have a closing tag in your model: http://ellislab.com/codeigniter/user-guide/general/styleguide.html#php_closing_tag Cannot modify header information - headers already sent by...? - El Forum - 09-25-2010 [eluser]Developer13[/eluser] @Vega - Although you've hit a valid point that will ultimately provide a superficial solution to the problem of whitespace after the closing tag, and although it's "recommended practice", the omission of closing tags (even in PHP-only files) just doesn't seem like a proper solution. To me, it's kind of like turning error reporting off on warnings and notices to not be bothered with non-fatal issues an application might have just to be able to continue with bad programming practices. Cannot modify header information - headers already sent by...? - El Forum - 09-26-2010 [eluser]anna16[/eluser] @Vega Thank you very much. |