Welcome Guest, Not a member yet? Register   Sign In
Error- Cannot modify header information - headers already sent
#1

[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)
#2

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

??
#3

[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
#4

[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?
#5

[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!




Theme © iAndrew 2016 - Forum software by © MyBB