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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with PHP code or me

    Hi ,

    I am having a problem with some code .. I am getting this error on the top of the page when browsing:

    "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/59/8551159/html/eswap/index.php:1) in /home/content/59/8551159/html/eswap/includes/session.php on line 30"

    www.lismoretraders.com.au

    It wouldn't let me past all the code due to size..

    Thankyou, Tim

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Move your session_start() to the top of the page, or at least before you output anything.

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,324
    Thanks
    60
    Thanked 525 Times in 512 Posts
    Blog Entries
    4
    To add to the above, anything that relies on the use of cookies (which session start does) must be done before anything is sent to the browser. This includes whitespace before the <html> tag.

    For more info, there is a link in my signature about this.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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