View Full Version : header already sent?
arob42
01-17-2005, 05:49 AM
I'm hacking the code and I am getting the following error message when I read a post:
Unable to add cookies, header already sent.
File: <new file that I added to forum/includes directory>
Line: 1
It lists a new php file that I am including in the functions_bbcodeparse.php via require_once(). I'm just trying to understand the code right now. Does anyone know what this error message means and what might cause it. The error message is displayed from around line 2466 in functions.php (search for 'cant_set_cookies'). Thanks.
Tekton
01-17-2005, 05:59 AM
What are you adding? Any code we can see?
deathemperor
01-17-2005, 11:26 AM
I'm hacking the code and I am getting the following error message when I read a post:
Unable to add cookies, header already sent.
File: <new file that I added to forum/includes directory>
Line: 1
It lists a new php file that I am including in the functions_bbcodeparse.php via require_once(). I'm just trying to understand the code right now. Does anyone know what this error message means and what might cause it. The error message is displayed from around line 2466 in functions.php (search for 'cant_set_cookies'). Thanks.
the File: <new file that I added to forum/includes directory> may have a space before <?php, open it and remove that space.
Zachery
01-17-2005, 11:37 AM
I'm hacking the code and I am getting the following error message when I read a post:
Unable to add cookies, header already sent.
File: <new file that I added to forum/includes directory>
Line: 1
It lists a new php file that I am including in the functions_bbcodeparse.php via require_once(). I'm just trying to understand the code right now. Does anyone know what this error message means and what might cause it. The error message is displayed from around line 2466 in functions.php (search for 'cant_set_cookies'). Thanks.
We need to see the exact error 99% of the time to be able to help
arob42
01-17-2005, 01:37 PM
the File: <new file that I added to forum/includes directory> may have a space before <?php, open it and remove that space.
The file not only has a space before it, it has a whole javascript function defined before it! The function is called by a new clickable image I'm placing into the text via the parse_bbcode2() function. I want to create a new popup window when the image is clicked. I'm guessing this is probably a bad place to put a javacript function definition. Any recommendation where to put it?
Except for this cookie problem, everthing else seems to be working. When the image is clicked the popup window appears with the contents I specified. I can give more details this evening. Got to go for awhile now. Thanks for all the help! --Robert
Tekton
01-17-2005, 01:44 PM
You can't set cookies or header information after you already start sending stuff above it. Your PHP most likely has to go first.
deathemperor
01-17-2005, 01:45 PM
if it's in vbulletin board, you get to place that javascript code in a proper template, there's no way it works if you place it in one of vbulletin's files, well if it works it's still not good to place it there.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.