cookies --Warning: Cannot modify header information - headers already sent by (output

Discussion in 'MySQL' started by the_one, Jun 28, 2007.

  1. #1
    hi,
    this is another script i am using and its giving me an error

    error:
    and this is the php .
    where is the error. help:(

    help :(
     
    the_one, Jun 28, 2007 IP
  2. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you using session_start(); anywhere?
     
    rgchris, Jun 28, 2007 IP
  3. the_one

    the_one Banned

    Messages:
    344
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i dont know . i just downloaded a script and edit as it was told in read me file:)

    where should i check:(
     
    the_one, Jun 29, 2007 IP
  4. froggy

    froggy Member

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Unless you've defined dbQuery as a function in the script that cals this one, shouldn't the line:
    be

    ?


    also try replacing
    with
    Also make sure there's no whitespace being produced before the cookies are set.
     
    froggy, Jul 14, 2007 IP
  5. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #5
    The problem is the error message shown before the "setcookie" command is executed. This error message is because your "dbQuery" is failing.
    $guestips=dbQuery("SELECT ip FROM guest_log WHERE (ip='$ip')", true);
    dbQuery("INSERT INTO `guest_log` ( `time` , `ip` ) VALUES ('".time()."', '$ip')", true);

    1 of the above is failing. (Most probably the first one.)
    Check your database to make sure that the table "guest_log" exists.

    After fixing this you should not get the cookie error.
    regards :)
     
    JEET, Jul 14, 2007 IP