Headers already sent... Headers already sent...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Headers already sent...

Started by DefenceTalk.com, October 22, 2003, 06:25:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

Guys, I am getting these errors... I don't know why I didn't notice them before. They just started appearing all of the sudden:

Warning:  Cannot modify header information - headers already sent by (output started at /home/defence/public_html/pictures/index.php:583) in /home/defence/public_html/pictures/themes/default/theme.php on line 772

Warning:  Cannot modify header information - headers already sent by (output started at /home/defence/public_html/pictures/index.php:583) in /home/defence/public_html/pictures/include/functions.inc.php on line 51

Gallery LINK:
www.defencetalk.com/pictures  <(scroll down...<)

I am using all new files just template.html in themes is the old one.

:(

Thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Tarique Sani

Scroll down further and you will see the reason - turn debug on and everything will be clear :)
SANIsoft PHP applications for E Biz

DefenceTalk.com

This is what I am getting:


<tr><td class="tableb">USER: <pre>Array
(
    [ID] => e6fdbb644f266a20b664193ec8eef1a3
    [am] => 1
    [liv] => Array
        (
            [0] => 488
            [1] => 1067
            [2] => 532
            [3] => 519
            [4] => 943
        )

    [search] => ###missiles
)
</pre></td></tr><td class="tableb"><tr><td class="tableb">USER DATA: <pre>Array
(
    [0] => 3
    [user_id] => 3
    [1] => WebMaster
    [user_name] => WebMaster
    [2] => 1
    [user_level] => 1
    [group_quota] => 0
    [can_rate_pictures] => 3
    [can_send_ecards] => 3
    [can_post_comments] => 3
    [can_upload_pictures] => 3
    [can_create_albums] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
)
</pre></td></tr><td class="tableb"><tr><td class="tableb">Queries: <pre>Array
(
    [0] => SELECT user_id, username as user_name, user_level FROM `defence_xmb2`.phpbb_sessions INNER JOIN `defence_xmb2`.phpbb_users ON session_user_id = user_id WHERE session_id='2fa6b3ebca5c43018caec03ed8bb1b98' AND session_user_id ='3'
    [1] => SELECT (ug.group_id + 5) as group_id FROM `defence_xmb2`.phpbb_user_group as ug LEFT JOIN `defence_xmb2`.phpbb_groups as g ON ug.group_id = g.group_id WHERE user_id = 3 AND user_pending = 0 AND group_single_user = 0
    [2] => SELECT  group_quota as gq,                 can_rate_pictures as crp,                 can_send_ecards as cse,                 can_post_comments as cpc,                 can_upload_pictures as cup,                 can_create_albums as cca,                 pub_upl_need_approval as puna,                 priv_upl_need_approval as pruna FROM cpg11d_usergroups WHERE group_id IN (1,2,10,23)
    [3] => DELETE FROM cpg11d_banned WHERE expiry < 1066830828
    [4] => SELECT * FROM cpg11d_banned WHERE ip_addr='156.153.255.134' OR ip_addr='156.153.255.134' OR user_id=3
    [5] => SELECT cid, name, description FROM cpg11d_categories WHERE parent = ''  ORDER BY pos
    [6] => SELECT aid FROM cpg11d_albums WHERE category = 49
    [7] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 49
    [8] => SELECT aid FROM cpg11d_albums WHERE category = 6
    [9] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 6
    [10] => SELECT aid FROM cpg11d_albums WHERE category = 9
    [11] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 9
    [12] => SELECT aid FROM cpg11d_albums WHERE category = 7
    [13] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 7
    [14] => SELECT aid FROM cpg11d_albums WHERE category = 10
    [15] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 10
    [16] => SELECT aid FROM cpg11d_albums WHERE category = 11
    [17] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 11
    [18] => SELECT aid FROM cpg11d_albums WHERE category = 12
    [19] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 12
    [20] => SELECT aid FROM cpg11d_albums WHERE category = 8
    [21] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 8
    [22] => SELECT aid FROM cpg11d_albums WHERE category >= 10000
    [23] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category >= 10000
    [24] => SELECT aid FROM cpg11d_albums WHERE category = 50
    [25] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 50
    [26] => SELECT count(*) FROM cpg11d_albums WHERE 1
    [27] => SELECT count(*) FROM cpg11d_pictures WHERE 1
    [28] => SELECT count(*) FROM cpg11d_comments WHERE 1
    [29] => SELECT count(*) FROM cpg11d_categories WHERE 1
    [30] => SELECT sum(hits) FROM cpg11d_pictures WHERE 1
    [31] => SELECT count(*) FROM cpg11d_albums WHERE category = ''
    [32] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES'
    [33] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES'
    [34] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid FROM cpg11d_pictures WHERE  randpos IN (2) AND approved = 'YES'  ORDER BY RAND() LIMIT 6
    [35] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES'
    [36] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, owner_id, owner_name, aid FROM cpg11d_pictures WHERE approved = 'YES'  ORDER BY pid DESC  LIMIT 0 ,12
    [37] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND votes >= '3'
    [38] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, pic_rating, votes, aid FROM cpg11d_pictures WHERE approved = 'YES' AND votes >= '3'  ORDER BY ROUND((pic_rating+1)/2000) DESC, votes DESC  LIMIT 0 ,6
    [39] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND hits > 0  
    [40] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, hits, aid FROM cpg11d_pictures WHERE approved = 'YES'AND hits > 0  ORDER BY hits DESC  LIMIT 0 ,12
    [41] => SELECT count(*) FROM cpg11d_pictures WHERE 1


I have NO idea whats wrong, could someone please help me out. :(

Thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Tarique Sani

[size=24]There was an error while processing a database query  [/size]

You dont see that ? when you scroll down - even when not in debug mode?

While in debug more you will be able to see the offending query in a text box
SANIsoft PHP applications for E Biz

DefenceTalk.com

Well, why is it putting out the header twice? I see the banner, top nav once and then again it shows the same thing again after the ERROR.

It shouldn't be showing that to begin with.... :(

Debug mode stretches out for miles.... thats why I posted the output from debug mode.... hope someone can figure out and provide a fix.

Thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Tarique Sani

The problem is not with the headers - it is with the query failing...

If the query does not fail the error will not be generated which will in turn not lead to the headers being sent twice....
SANIsoft PHP applications for E Biz

DefenceTalk.com

I know that. How do i fix it?   :cry:

I have enabled debug mode, so maybe you can figure out whats wrong.

Thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

For now, I have taken down the index.php page so that I can keep debug info up for as long as possible... the index.php can be reached here for thsoe who WOULD LIKE TO HELP OUT HERE.

http://www.defencetalk.com/pictures/indexx1.php

I just noticed:

While executing query "SELECT count(*) FROM cpg11d_pictures WHERE 1" on 0

mySQL error: Table 'defence_xmb2.cpg11d_pictures' doesn't exist




Please help.

Thanks
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

Tarique Sani

OK I can get two pointers -

1) your guest / visitor counter is in the middle of stuff

2) your setting for  "The content of the main page" is going awry becuase of that

First turn off the guest / visitor online counter and see if the errors go away
SANIsoft PHP applications for E Biz

DefenceTalk.com

Quote from: "tarique"OK I can get two pointers -

1) your guest / visitor counter is in the middle of stuff

2) your setting for  "The content of the main page" is going awry becuase of that

First turn off the guest / visitor online counter and see if the errors go away

YOU DA MAN!!! THANK YOU. :)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

The problem was that I had:

include ("rootpath/forums/online.php) on INDEX.PHP in the gallery i inserted the code right before "page footer" at the bottom.

 < this include was being used to get WHOISONLINE info from the forums

Going to figure another way to include this there but since its causing trouble I will keep it out for now.

Thank u
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

DefenceTalk.com

This "anycontent.php" feature is pretty cool.

Now I can display the same thing without getting that lousy error. Good job guys. :)
www.defencetalk.com/pictures < go at the bottom "who is online" <
 8)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.defencetalk.com%2Fpictures%2Fsignature_cpg.php&hash=c0098ed5314d39beb9e8799c7c8787a9a0353b45)

sectora

I am sorry but even after reading through the information here I cannot get to the heart of the problem :(

I get the same message:

Warning:  Cannot modify header information - headers already sent by (output started at /home/users/k/i/kiefer/www/header.php:32) in /home/users/k/i/kiefer/www/modules/coppermine/include/functions.inc.php on line 208

But where do I start to look for the solution? I do not have the user/counter (as far as I know) and how can I enable debug... and on what?! PHP Nuke?

Sorry for my ignorance... learning is falling down but trying to keep getting up!

Joachim Müller

@sectora: your problem is probably not caused by the usage of a counter, but more generally speaking because you (or the script rather) try to send the headers twice. This is in the faq:
QuoteWarning: Cannot add header information - header was already sent ... in C:\Apache\htdocs\read.php on line 4 - you had some text output first (e.g. the doctype declaration or <html>) and called the function header() afterwards. This is most often the case when using cookie stuff. Remember you can not use header() twice!
We can't help you at all if you don't give us a link and as much information as necessary.

I suggest you read the faq carefully and then post more details.

GauGau

sectora

Sorry sorry... I was so in the middle of stuff that my whole universe revolved around these files :) I forgot that the 'outside' world keep on turning! :)

My phpNuke test bed is a http://www.kiefer.nl

I'll eneable the module again so that you can see this...

I am on the web with both Internet Explorer 5.2 for OSX and Safari for OSX Macintosh.

Albert