|
Joined: Apr 2003
Posts: 359
Enthusiast
|
Enthusiast
Joined: Apr 2003
Posts: 359 |
I just upgraded from 6.3.1 to 6.4 and there didn't seem to be any problems except for some errors in regards to some polls not upgrading properly.
I do see this error when I click on "Who's Online":
Warning: Cannot modify header information - headers already sent by (output started at /home/smoknz28/public_html/ubbthreads/languages/english/online.php:180) in /home/smoknz28/public_html/ubbthreads/ubbt.inc.php on line 269
Seems to be the only error I'm finding so far. Any thoughts on this?
Thanks, Gonzo
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
did you add a mod.. the biggest culpti is a missing ; or } or " so if you added a mod go back and look at that line of code..
|
|
|
|
Joined: Apr 2003
Posts: 359
Enthusiast
|
Enthusiast
Joined: Apr 2003
Posts: 359 |
Yes I did, but from what I recall....I had the error before I had added the mods.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
A header already sent error is usually extra space after the php closing tag ?> I'd check the online script, template and language file and make sure there's no extra spaces after the php closing tags.
|
|
|
|
Joined: Apr 2003
Posts: 359
Enthusiast
|
Enthusiast
Joined: Apr 2003
Posts: 359 |
Thanks guys....going in to check.
|
|
|
|
Joined: Apr 2003
Posts: 359
Enthusiast
|
Enthusiast
Joined: Apr 2003
Posts: 359 |
Yup, Josh....you nailed it. Working like a charm now....had extra spaces after the closing php tag in each of the files. Much appreciated!
|
|
|
|
Joined: Sep 1999
Posts: 76
Power User
|
Power User
Joined: Sep 1999
Posts: 76 |
[] JoshPet said:A header already sent error is usually extra space after the php closing tag ?> I'd check the online script, template and language file and make sure there's no extra spaces after the php closing tags. [/] So what do you suggest if one can't find any offending white space? My particular problem is that I have login box on my site's index.php. It all worked fine when I was running 6.2 but when I recently upgraded to 6.4, I start getting these errors (headers already sent, etc). And, I only get the error the first time I hit the site and I'm already logged in. If I go to the forums and return to the main site index, I won't see the error again. My login box is simply a hacked loginpal script, with a lot of stuff trimmed out, and the user authetication added at the beginning. The error I get is: Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/vfighter/index.php:24) in /usr/www/users/vfighter/versuscity/ubbt.inc.php on line 572and line 572 of ubbt.inc.php is the call to setcookie.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
It's usually there somewhere. I can be in language files, templates, any of the pal box scripts. It's somewhere on that page after the ?> tag.
The error happens if output gets echoed to the page before the cookies are set. That output gets echoed first by being outside the php tags.
It only happens once because that particular cookie probably doesn't need to be reset on the second load of that same page. Hence it's not breaking the rules there.
When all else fails, if you can't find it, you need to start with fresh unmodified scripts and move from there.
|
|
|
|
Joined: Sep 1999
Posts: 76
Power User
|
Power User
Joined: Sep 1999
Posts: 76 |
[] JoshPet said:When all else fails, if you can't find it, you need to start with fresh unmodified scripts and move from there. [/] See, the funny thing here is that nothing has changed except for ubbt.inc.php when I upgraded to 6.4 I can seemingly replicate the problem in my front page login script. When I authenticate the user: $userob = new user; $user = $userob -> authenticate("");$user = $userob -> authenticate("U_Username,U_Privates,U_Number"); list($Username,$Privates,$Number) = $user; The line shown in bold isn't usually there, but if I add it in, then I'll get two instances of the error. The loginpal from IIP has that line in bold in there. Please note that I'm not using any pals or the IIP at all. I have just the one login script which my index.php includes, and it worked perfectly fine prior to 6.4.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
All signs still point to output before the cookies get set. Of course you can replicate it with the authenticate function - the authenticate function is what sets the cookies. You don't need to do it twice. Look at any files which get included or echoed above that. It's what's above that in the script that might be causing trouble.
|
|
|
|
Joined: Sep 1999
Posts: 76
Power User
|
Power User
Joined: Sep 1999
Posts: 76 |
[] JoshPet said:Look at any files which get included or echoed above that. It's what's above that in the script that might be causing trouble. [/] OK, so here's what is above the authentication in my login script: <br /><?<br />// --------------------------------<br />// define some stuff<br /> $spacer = " ";<br /> $loginboxsize = "10";<br /><br />// --------------------------------<br />// require the language file<br /> require "$path/languages/$w3t_language/login.php";<br /><br />// --------------------------------<br />// authenticate visitor<br /> $userob = new user;<br /> $user = $userob -> authenticate("U_Username,U_Privates,U_Number");<br /> list($Username,$Privates,$Number) = $user;<br /> Note that $path is defined in my main index.php which calls my login script like this: <br /> <?php include "minilogin.php"; ?><br /> At first I thought that the white space before the <?php above was causing the error, but even when I remove it the error remains. Do you see anything here that's likely to be the cause?
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Try this online template and see if that helps.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Did you check that login.php language file for extra space before or after it's closing tag? Then on your index.php file... before this is included: <?php include "minilogin.php"; ?> Make sure there is NO output. Again there can be no output to the page before the cookie is set. So that include above should be the very first thing on the page. If it's not, the authenticate function needs to be moved BEFORE any output, as it sets the cookies.
|
|
|
|
Joined: Sep 1999
Posts: 76
Power User
|
Power User
Joined: Sep 1999
Posts: 76 |
Thanks Josh! That was the ticket. The authentication was occuring within my login script which was being called by the main site's index.php. However I had a lot of output before the actual call. What I did was to move the authetication out of the login script and into the main index.php. Hmmm, kinda like how it's done in IIP... *doh* Thanks again for the help.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Excatly. Glad you got it figured out.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|