Forum Moderators: coopster
It is occurring on my index page - it's the first page loaded, it's not undergoing a redirect.
I've tried including the ob_start statement, although my setcookie was the very first command anyway - I even tried removing my .htaccess file, if that was causing any headers.
The file is plain PHP, starting at Line 1 column 1 (or so reports Notepad++), reading:
<?php
ob_start();
if(empty($_COOKIE['popup'])){
setcookie ("popup", "1", time()+604800);
//echo 'i set the cookie'; //debug only
}
[i][... load of PHP, completely enclosed in the PHP tags...][/i]
ob_end_flush();
?> Now, I started to go crazy, so I opened the PHP file in my online file-editor management tool (my host runs Plesk) - and it reports the file looks like:
<?php
ob_start();
if(empty($_COOKIE['popup'])){
setcookie ("popup", "1", time()+604800);
//echo 'i set the cookie';
}
[... yada yada yada...]
Where did the little "dot" come from (it appears as a dot/bullet in my file viewer, not as the HTML entity)?
Details of host (no control over this):
Apache VersionApache/2.2.3 (Debian) mod_jk/1.2.18 mod_python/3.2.10 Python/2.4.4 PHP/4.4.4-8+etch4 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8
Cheers-
Daniel
Sorry I can't offer a better explanation but that is all I can think of
It appears to be some hidden character... my text editor is in UTF8 - but the error is happening before the DOCTYPE encoding would even be sent to the browser... there is some file output, that's hidden, right at the start of my file that text-editors ignore, but readers output.
Couple possibilities:

Google " PHP" and the first thread is right here [webmasterworld.com]..
Byte order mark? (BOM)
Uploading in ASCII format? Do you have command line access on your server, and can edit in nano, pico, etc.? Open it and resave it, does it work?
Windows and Linux end of line characters are different. I have all sorts of issues with Notepad edited files in various Linux servers for this reason. - perl scripts often will not run unless saved in Unix format. There is no specific error, it's just premature end of script headers.
I use HomeSite, and save all files in Unix format prior to deployment. This is the same reason some people see "little black boxes" where line returns should be when editing my files.
So if all else fails, get a good editor that supports Unix format when saving files, this has eliminated a lot of problems for me.