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

[eluser]Unknown[/eluser]
Actually Some of the Hosts they Use the PHP Header Function to Redirect our Site! So In those kind of servers if we use redirect() it will give the error, Because the redirect() function use 'PHP header' to redirect url, So the Best Way is use javascript '[removed].href=""' to load Your URL.

100% it will be work

Example:
//Your Code in Redirect
redirect('site/function1');

//Alternate Code
$url = 'site/function1'
echo'
[removed]
[removed].href = "'.base_url().'index.php?/'.$url.'";
[removed]
';

I am not sure its a right code! But I am using it for solve the Issue!

Thanking You!


Messages In This Thread
Message Cannot modify header information - headers already sent - by El Forum - 04-02-2011, 02:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB