Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    217
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Setting a Cookie

    Anytime i try to set a cookie within my script i'm getting this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/fantasy3/public_html/ichuson/includes/html.php:5) in /home/fantasy3/public_html/ichuson/login.php on line 75

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    Set the cookie before you do anything else on the page in question.

  • #3
    Regular Coder
    Join Date
    Jan 2007
    Posts
    217
    Thanks
    9
    Thanked 0 Times in 0 Posts
    umm, but i inlclude my layout at the top of each page =X

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Set the cookie before you output anything else. If you have to include the template first look into output buffering. http://www.php.net/ob_start


  •  

    Posting Permissions

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