The Arcive of vBulletin Modifications Site. |
|
online.php header problem Details »»
|
|||||||||||||||||||||||||
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
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
What the second line of online.php? Could it be online.php looks like this:
Code:
1: 2: 3: <?php 4: error_reporting(7); |
|
#3
|
|||
|
|||
|
Hi Chen,
well yes 1 blank line before <?php. PHP Code:
|
|
#4
|
||||
|
||||
|
That looks about right...
Could it be the setcookie()-function that fails for some reason and produces some kind of error output? |
|
#5
|
|||
|
|||
|
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
|
|
#6
|
||||
|
||||
|
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. |
|
#7
|
||||
|
||||
|
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.
|
|
#8
|
|||
|
|||
|
Hi Sparks, Hi Chen,
ok, thanks for explaining. ![]() looks like the problem is solved now. Thanks again to both of you! regards Tina |
|
#9
|
||||
|
||||
|
Thx for explaining!
|
![]() |
|
|