www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] Can't Set Cookie

  1. #1
    Join Date
    Dec 2008
    Posts
    69

    resolved [RESOLVED] Can't Set Cookie

    I have a set cookie function supposed to run... But it keeps screaming:
    Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\www\Faction\index.php:1) in D:\xampp\htdocs\www\Faction\functions\do.php on line 11
    Now, I know what that means. Problem is, I haven't sent any output before using this. Heck, I even tried using a dummy setcookie function at the first line of index.php and it said the same. What's going on?

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    Do you have any extra whitespace at the beginning of the file? Are you including any other files which might have whitespace? If all else fails do an ob_start and flush.

  3. #3
    Join Date
    Dec 2008
    Posts
    69
    Nope. And buffering doesn't work ):

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,334
    Make sure your scripts are saved either as plain ASCII text or as UTF-8 without the BOM (byte order mark). Otherwise that BOM will be output before the <?php tag no matter what you do.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Dec 2008
    Posts
    69
    You, my dear sir, are frickin' brilliant. Thank you!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles