1 (edited by 2012-03-22 17:51:28)

Topic: PHP Warning: Cannot modify header information

Heya!

I've got some problems since I put up my website on my webhost. It worked fine on my localhost.
I only changed the comment system in default.php so you comment with your website login name(worked fine on localhost)

It works to login on cutenews, but wherever I click I automatically logout and return to the login screen.

If this is about CHMOD~ 777, I couldnt chmod every file/folder. (I couldnt access cutenews at all if I did) so I only chmod comments.txt etc and the other neccessary txt/php files.

[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 91
[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 97
[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 98

Line 91,97,98 in order:

setcookie("lastusername", $username, time()+1012324305);
setcookie("username", $username);
setcookie("md5_password", $cmd5_password);


All help is appreciated,
Soder.

Re: PHP Warning: Cannot modify header information

Heya!

I've got some problems since I put up my website on my webhost. It worked fine on my localhost.
I only changed the comment system in default.php so you comment with your website login name(worked fine on localhost)

It works to login on cutenews, but wherever I click I automatically logout and return to the login screen.

If this is about CHMOD~ 777, I couldnt chmod every file/folder. (I couldnt access cutenews at all if I did) so I only chmod comments.txt etc and the other neccessary txt/php files.

[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 91
[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 97
[22-Mar-2012 17:38:53 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/epicbook/public_html/beta/news/index.php:2) in /home/epicbook/public_html/beta/news/index.php on line 98

Line 91,97,98 in order:

setcookie("lastusername", $username, time()+1012324305);
setcookie("username", $username);
setcookie("md5_password", $cmd5_password);


All help is appreciated,
Soder.


Dear User!

Please make sure that the following files

./inc/functions.inc.php
./data/config.php
./skins/default.skin.php (every skin file)

don't begin from the BOM-maker, but from  <?php and end with ?> without any spaces. This could be the problem.

Best regards,
CN Support team

3 (edited by 2012-03-23 12:02:52)

Re: PHP Warning: Cannot modify header information

What's line 2 of beta/news/index.php? BOM would be line 0, if I recall correcly (or could be line 1)

Re: PHP Warning: Cannot modify header information

What's line 2 of beta/news/index.php? BOM would be line 0, if I recall correcly (or could be line 1)

Line 2 is <?php.
The first line is just a blank line.

About the other files from 2 posts above, all 3 are there, none are empty.

Re: PHP Warning: Cannot modify header information

remove the blank line and problem should be solved https://cutephp.com/forum/style_emoticons/default/smile.gif

Re: PHP Warning: Cannot modify header information

remove the blank line and problem should be solved https://cutephp.com/forum/style_emoticons/default/smile.gif

Cmon, a blank line have never been a problem before >.<

Thanks alot!

Cheers!