Results 1 to 6 of 6

Thread: PHP Problems

  1. #1
    Join Date
    Aug 2007
    Posts
    149
    Tokens
    2,810

    Latest Awards:

    Default PHP Problems

    Hey guys,

    I've just edited my config file for my radio stats, and I keep getting the following error:
    Code:
    Warning:  session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/afterhab/public_html/live/stats/radio_stats.php:2) in /home/REMOVED/public_html/staff/includes/config.php on line 3
    Anybody know the cause of this?

  2. #2
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Post the code?
    Last edited by Excellent2; 30-09-2008 at 11:38 PM.
    Back for a while.

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Remove line 3, its already been sent in an include or something.
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    session_start() can only be at the top, well after/before other functions like ob_start()

  5. #5
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    As far as my own personal knowledge extends you cannot have any anything outputted to the browser before session_start() is used for example:

    This would error
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> 
    <head> 

    <?php

    session_start
    ();

    ?>
    That is because you have sent an output to the browser, in this case in HTML form. The proper way todo it would be:

    PHP Code:
    <?php

    session_start
    ();

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> 
    <head>

    I may be wrong but that's what my personal understanding is. Also note I have seen a single space before PHP tags to have also affected it.


    www.fragme.co = a project.

  6. #6
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    As far as my own personal knowledge extends you cannot have any anything outputted to the browser before session_start() is used for example:

    This would error
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> 
    <head> 

    <?php

    session_start
    ();

    ?>
    That is because you have sent an output to the browser, in this case in HTML form. The proper way todo it would be:

    PHP Code:
    <?php

    session_start
    ();

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> 
    <head>
    I may be wrong but that's what my personal understanding is. Also note I have seen a single space before PHP tags to have also affected it.
    I support that theory


Posting Permissions

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