0

Possible Duplicate:
Headers already sent by PHP

I dont see any whitespace, I'm not echoing.... What is causing the problem?

Warning: Cannot modify header information - headers already sent by (output started at /home/k9ciz4dv/public_html/functions/account/set_location_cookie.php:1) in /home/k9ciz4dv/public_html/functions/account/set_location_cookie.php on line 10

<?php 
$xookiezip = $_REQUEST['xookiezip'];
$cookie_expire = time() + (86400 * 20);

if($xookiezip == 'findme'){
$cookie_expire = time() - (86400 * 30);
setcookie('cookiezip', "" , $cookie_expire, '/', $domain_cookie, FALSE, TRUE);
}
else {
setcookie('cookiezip', "$xookiezip" , $cookie_expire, '/', $domain_cookie, FALSE, TRUE);
}
?>
Community
  • 1
  • 1
MHowey
  • 681
  • 2
  • 6
  • 19
  • 1
    Whitespace is not always visible in text-editors. Use a hexeditor instead. – hakre Jan 08 '12 at 16:26
  • So many, many duplicates when searching for the error message... You either have a space in front of your `` or a BOM – Pekka Jan 08 '12 at 16:26
  • I believe that error is stating that the `setcookie()` on that line in that file is causing the error, but the whitespace is coming from an earlier file included. – Jared Farrish Jan 08 '12 at 16:27
  • 4
    Specifically see this answer: http://stackoverflow.com/a/8028987/367456 – hakre Jan 08 '12 at 16:27
  • Where is $domain_cookie set? Is this file included somewhere else? – Josh Jan 08 '12 at 16:28
  • @Josh Yes, the the $domain_cookie is included somewhere else but I removed the file out and I still get the same error. – MHowey Jan 08 '12 at 16:30
  • @Pekka No space that I can find. Weird because this has been working for months. Just started today... What is a BOM? – MHowey Jan 08 '12 at 16:31
  • @MHowey check out Hakre's link – Pekka Jan 08 '12 at 16:32
  • @Jared Farrish Im not including any other files. This is the whole page. I removed out the redirect as shown above and Im still having the problem – MHowey Jan 08 '12 at 16:32
  • @Josh Well I was getting the error before I removed the $domain_cookie. And yes your wrong lol, if the domain is not included php adds it in. But thank you Josh – MHowey Jan 08 '12 at 16:36
  • I deleted the page and added it back in. Problem solved. I guess @hakre was right. Hidden whitespace was causing the issue – MHowey Jan 08 '12 at 16:46

0 Answers0