PDA

View Full Version : "unable to add cookies, header already sent" ???


Mikhailtech
12-04-2007, 11:34 PM
I'm getting the following error when I try to load a custom php page:


Unable to add cookies, header already sent.
File: /home/xxx/public_html/xxx/index.php
Line: 2

On line 2 the only code is an opening <?php tag.

I'm confused ...

--------------- Added 1196818988 at 1196818988 ---------------

I should point out this happens when I'm trying to use a CHDIR function to get into my forum directory so I can use a .php file from there. However, another script/php file I have already does the same thing, so I wonder if it's an issue of duplication?

--------------- Added 1196819969 at 1196819969 ---------------

nevermind figured it out

nhatrang
12-18-2007, 04:56 AM
what did you do to figure it out? please help

Mikhailtech
12-18-2007, 03:06 PM
Each PHP file has a line like this:

define('THIS_SCRIPT', 'xxx');

Just replace xxx with a unique name for each page and it solves the problem, otherwise I'm guessing it assumes you're trying to run the same script twice.