TheLab
01-13-2004, 10:17 AM
Hello people :)
I was looking my error log on the server and i found this line:
[Tue Jan 13 05:49:57 2004] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/***/***/announcement.php:1) in /home/***/***/admin/functions.php on line 1667
In the admin/functions.php on line 1667 i have this one:
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);
The lines near it says:
if (defined('USE_COOKIE_WORKAROUND')) {
// It's been reported that there's a bug in PHP 4.2.0/4.2.1 with Apache 2 causing setcookie() to not work correctly.
// This is the workaround. If you need to use this code, please add:
// define('USE_COOKIE_WORKAROUND', 1);
// to your config.php.
if (!$value) {
// need to do this so IE deletes the cookie correctly
$expire = time() - 31536001;
$value = 'deleted';
}
$cookieheader = "Set-Cookie: $name=".urlencode($value);
if ($expire) {
$cookieheader .= '; expires='.gmdate('D, d-M-Y H:i:s', $expire).' GMT';
}
if ($cookiepath) {
$cookieheader .= "; path=$cookiepath";
}
if ($cookiedomain) {
$cookieheader .= "; domain=$cookiedomain";
}
if ($secure) {
$cookieheader .= '; secure';
}
header($cookieheader, false); // force multiple headers of same type
} else {
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);
}
}
Any ideas on that?! :ermm:
I was looking my error log on the server and i found this line:
[Tue Jan 13 05:49:57 2004] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/***/***/announcement.php:1) in /home/***/***/admin/functions.php on line 1667
In the admin/functions.php on line 1667 i have this one:
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);
The lines near it says:
if (defined('USE_COOKIE_WORKAROUND')) {
// It's been reported that there's a bug in PHP 4.2.0/4.2.1 with Apache 2 causing setcookie() to not work correctly.
// This is the workaround. If you need to use this code, please add:
// define('USE_COOKIE_WORKAROUND', 1);
// to your config.php.
if (!$value) {
// need to do this so IE deletes the cookie correctly
$expire = time() - 31536001;
$value = 'deleted';
}
$cookieheader = "Set-Cookie: $name=".urlencode($value);
if ($expire) {
$cookieheader .= '; expires='.gmdate('D, d-M-Y H:i:s', $expire).' GMT';
}
if ($cookiepath) {
$cookieheader .= "; path=$cookiepath";
}
if ($cookiedomain) {
$cookieheader .= "; domain=$cookiedomain";
}
if ($secure) {
$cookieheader .= '; secure';
}
header($cookieheader, false); // force multiple headers of same type
} else {
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, $secure);
}
}
Any ideas on that?! :ermm: