Results 1 to 4 of 4

Thread: Cookie Problem!

  1. #1

    Thread Starter
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Cookie Problem!

    http://www.questfor3d.com/loginscript.php
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/a/m/damasterjo/html/loginscript.php:3) in /home/content/d/a/m/damasterjo/html/loginscript.php on line 88

    line 88
    setcookie("UsersName", $NName, time()+604800);

    $NName is proper
    Software languages known:
    Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
    Software API's known:
    Directx 7 and 8
    Internet languages, in the process of learning:
    HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Cookie Problem!

    Cookies have to be set before anything else has been written on your page.

    do you echo anything before you set your cookie?

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Cookie Problem!

    Line 88 is fine but as Lintz says you cannot send any data before the headers and a cookie is a header.

    Look at the error message again:
    (output started at /home/content/d/a/m/damasterjo/html/loginscript.php:3)

    The highlighted bit tells you where the data is being sent, you need to correct that bit.

  4. #4
    Addicted Member
    Join Date
    Jan 2006
    Posts
    247

    Re: Cookie Problem!

    No Matter Where I set the cookie, it gives me mod header information. So stupid, anyway, if you see this Damasterjo, I moved all the scripts into a subdir "phptest" so for the scripts:

    http://www.questfor3d.com/phptest/phptest.php



Posting Permissions

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



Click Here to Expand Forum to Full Width