CodeIgniter Forums
Error- Cannot modify header information - headers already sent - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Error- Cannot modify header information - headers already sent (/thread-50736.html)



Error- Cannot modify header information - headers already sent - El Forum - 04-06-2012

[eluser]bleu[/eluser]
I am getting this error when I use this
Code:
header("Location: /");
to redirect to home page.I believe there is a javascript alert which come before this is called, that gives the below error, I cannot remove the alert so is there nay other way I can go about redirecting without giving me the below error ?



Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/dsdsd/application/core/MY_Controller.php:dsdsds)



Error- Cannot modify header information - headers already sent - El Forum - 04-06-2012

[eluser]Samus[/eluser]
Code:
redirect("/");

??


Error- Cannot modify header information - headers already sent - El Forum - 04-06-2012

[eluser]bleu[/eluser]
[quote author="Samus" date="1333729033"]
Code:
redirect("/");

??[/quote]

This does not solve the issue as it is the same as php header


Error- Cannot modify header information - headers already sent - El Forum - 04-08-2012

[eluser]bleu[/eluser]
[quote author="bleu" date="1333730720"][quote author="Samus" date="1333729033"]
Code:
redirect("/");

??[/quote]

This does not solve the issue as it is the same as php header[/quote]

Any Ideas as to how I may solve it?


Error- Cannot modify header information - headers already sent - El Forum - 04-08-2012

[eluser]InsiteFX[/eluser]
Check for white space before the opening PHP tags and do not use ending PHP tags!

Also make sure that you are not saving your files with the BOM!

View your html source file and see if there are strange characters in the top left size!