Advanced search  

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

Pages: [1]   Go Down

Author Topic: Headers already sent...  (Read 8425 times)

0 Members and 1 Guest are viewing this topic.

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« on: October 22, 2003, 06:25:36 am »

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
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Headers already sent...
« Reply #1 on: October 22, 2003, 06:34:53 am »

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

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #2 on: October 22, 2003, 03:58:46 pm »

This is what I am getting:

Code: [Select]

<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
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Headers already sent...
« Reply #3 on: October 22, 2003, 04:47:33 pm »

[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
Logged
SANIsoft PHP applications for E Biz

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #4 on: October 22, 2003, 05:01:09 pm »

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
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Headers already sent...
« Reply #5 on: October 22, 2003, 05:05:10 pm »

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....
Logged
SANIsoft PHP applications for E Biz

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #6 on: October 22, 2003, 05:23:01 pm »

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

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

Thanks
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #7 on: October 22, 2003, 05:33:47 pm »

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
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Headers already sent...
« Reply #8 on: October 22, 2003, 05:56:11 pm »

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
Logged
SANIsoft PHP applications for E Biz

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #9 on: October 22, 2003, 06:00:35 pm »

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. :)
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #10 on: October 22, 2003, 06:28:17 pm »

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
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Headers already sent...
« Reply #11 on: October 23, 2003, 06:17:09 am »

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)
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

sectora

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Same problem so hopefully you still have patience with me
« Reply #12 on: October 24, 2003, 10:46:00 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Headers already sent...
« Reply #13 on: October 25, 2003, 04:36:15 pm »

@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:
Quote
Warning: 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
Logged

sectora

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
It works in Explorer but it keep showing the error in Safari
« Reply #14 on: October 25, 2003, 06:39:34 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.