Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
online.php header problem Details »»
online.php header problem
Version: , by tkeil69575 tkeil69575 is offline
Developer Last Online: Sep 2007 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-02-2002 Last Update: Never Installs: 0
 
No support by the author.

Hi all,

i have the following parse error showing up from time to time. Its not always there though and I cant really simulate it. Sometimes it just goes away if I call up online.php again, but its bugging me badly.

Warning: Cannot add header information - headers already sent by (output started at /home/blabal.../forums/online.php:2) in /home/blabla.../forums/admin/functions.php on line 1601

Line 1601 in functions.php looks like this:

1597 if ($cookiedomain) {
1598 setcookie($name, $value, $expire, $cookiepath,
1599 $cookiedomain, $secure);
1600 } else {
1601 setcookie($name, $value, $expire, $cookiepath, '', $secure);
1602 }

Any of you have an idea what might be causing this?

regards Tina

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-02-2002, 11:33 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What the second line of online.php? Could it be online.php looks like this:
Code:
1: 
2: 
3: <?php
4: error_reporting(7);
(i.e you have blank lines at the top)
Reply With Quote
  #3  
Old 05-02-2002, 11:37 AM
tkeil69575 tkeil69575 is offline
 
Join Date: Nov 2001
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Chen,

well yes 1 blank line before <?php.

PHP Code:
2: <?php
3
:
4// Yes we realize that there are a lot of hard coded English words in this file.
5// Language abstraction is planned for vB v3.0
6
7error_reporting(7);
sorry, had another look, jus now. Guess that the bug?
Reply With Quote
  #4  
Old 05-02-2002, 11:42 AM
Sparkz's Avatar
Sparkz Sparkz is offline
 
Join Date: Nov 2001
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That looks about right...

Could it be the setcookie()-function that fails for some reason and produces some kind of error output?
Reply With Quote
  #5  
Old 05-02-2002, 11:56 AM
tkeil69575 tkeil69575 is offline
 
Join Date: Nov 2001
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Sparkz,

thanks for the reply. Well, yes that was my first thought, but somehow I doubt it because of the Warning regarding the header. I mean what has the cookiesetting to do with the header warning.

According to my understanding of line 1601, this comes into effect if I dont have my domainname set as the cookiepath in the adminsettings of my board, which I havent because I'm only running one board on the server, thus having that set to "/".

mmh. well I've removed the blank line before <?php now - maybe that was it ? Was that what your where trying to tell me Chen?

Tina
Reply With Quote
  #6  
Old 05-02-2002, 12:11 PM
Sparkz's Avatar
Sparkz Sparkz is offline
 
Join Date: Nov 2001
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If some function fails and this causes any kind of output to be sent, you cannot send any more headers afterwards.

But having blank lines before <?php could also cause it.
Reply With Quote
  #7  
Old 05-02-2002, 12:42 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Having the blank line actually sent a blank line to the browser, as output. And as we all know, you can't send HTTP headers after you start sending output to the browser, and since setcookie() sends a header - it failed.
Reply With Quote
  #8  
Old 05-02-2002, 12:43 PM
tkeil69575 tkeil69575 is offline
 
Join Date: Nov 2001
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Sparks, Hi Chen,

ok, thanks for explaining.

looks like the problem is solved now. Thanks again to both of you!

regards Tina
Reply With Quote
  #9  
Old 11-10-2002, 01:46 PM
Dio Br@ndo's Avatar
Dio Br@ndo Dio Br@ndo is offline
 
Join Date: Apr 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx for explaining!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04484 seconds
  • Memory Usage 2,271KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete