SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Dec 2002
    Location
    Philadelphia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry header problem even with ob_start()

    I have been using this method for weeks now with no problem. Why am I getting an error now?????

    THERE IS NOTHING AT ALL BEFORE THE PHP TAG. NO HTML, NO NOTHING.
    PHP Code:

    <?php
    ob_start
    ();
    session_start(); 

    if (isset(
    $_SESSION['username'])) {
    include(
    "../../myinfo.php" ); 
    print(
    "<html><body bgcolor='khaki'>" );

    etcetc....
    and I get the following error:

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/suchandsuch/suchandsuch.com/suchandsuch/suchandsuch.php:1) in /hsphere/local/home/suchandsuch/suchandsuch.com/suchandsuch/suchandsuch.php on line 3

    (By the way, the php tag is on line 1, ob_start(); is on line 2, etc.)

  2. #2
    SitePoint Addict
    Join Date
    Dec 2002
    Location
    Philadelphia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow. I found out what it was. the line containing
    <?php
    had to be outdented all the way to the leftmost side of the page.

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Yes it would have to be like that, because the whitespace would have been outputted to the browser and therefore headers were sent


Bookmarks

Posting Permissions

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