1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Warning: session_start() : Cannot send session cookie - header already sent..

Discussion in 'PHP' started by neverbreaktherules, Dec 11, 2008.

  1. #1
    Hey

    I Am Getting This Error Message

    Please Help Me

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/user/public_html/index.php:1) in /home/user/public_html/funcs.php on line 44

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/user/public_html/index.php:1) in /home/user/public_html/funcs.php on line 44
     
    neverbreaktherules, Dec 11, 2008 IP
  2. celt

    celt Peon

    Messages:
    123
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to put your code handling cookies at the absolute beginning of the page, literally before anything else, or you will get this error message.
     
    celt, Dec 11, 2008 IP
  3. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #3
    you must have session_start() function at the very top of the php page. There should be absolutely NO html elements in the top of the page, even a white blank.
     
    olddocks, Dec 11, 2008 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Two things can use this:

    1) Outputs of HTML like said above.
    2) Outputs of headers using the header function.

    Peace,
     
    Barti1987, Dec 11, 2008 IP
  5. newgenservices

    newgenservices Well-Known Member

    Messages:
    862
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    1
    #5
    Try adding

    
    <?php
    ob_start();
    
    // Some PHP Code here 
    
    ob_flush();
    ?>
    
    Code (markup):
     
    newgenservices, Dec 11, 2008 IP
  6. neverbreaktherules

    neverbreaktherules Banned

    Messages:
    596
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks
    blank space was the reason
    fixed
     
    neverbreaktherules, Dec 11, 2008 IP