Jump to content

Warning: Cannot modify header information - headers already sent by (output sta


Gayner

Recommended Posts

 

Warning: Cannot modify header information - headers already sent by (output started at /home/praylife/public_html/index.php:29) in /home/praylife/public_html/index.php on line 188

 

Warning: Cannot modify header information - headers already sent by (output started at /home/praylife/public_html/index.php:29) in /home/praylife/public_html/index.php on line 189

 

 

 

 

LINE 189:

 

 

if (isset($_GET['skin']) && $_GET['skin'] == "0") {
setcookie("skinid", "default", time()+60*60*24*60, "/");
header('Location: ./?');
} 

 

LINE 29:

 

if(!isset($_COOKIE['skinid']))
{
    echo '<style type="text/css" media="all">@import url(2.css);</style>';
}

 

Ever since i moved from localhost to official server, this is happening why?

Link to comment
Share on other sites

Behold my psychic powers:

You have WampServer installed on your localhost. It's configured to use output buffering with buffer size set to 4096B. On your webhost no output buffering is enabled.

 

Still doesn't help me im not as Physic as u? So ur telling me to reduce my php code? lawls i just spent 4weeks on my index.php comon

 

and  rajivgonsalves i dont got access to edit .php ini on my server, it's sharedhosting ^^

Link to comment
Share on other sites

Why not recommended cause it's output buffering?

 

Basically it can show poor coding, meaning that you are not outputting your data at the end of the script, like you should. It is considered bad practice to output data as you go along in the code, it generally should be saved and printed out at the end altogether. To fix it, you can store all output into a string instead of echoing it out then just echo out that string at the end. The output buffering is basically like a massive band-aid over the code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.