SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2003
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Headers Already Sent

    I've looked at different peoples' solutions for the 'headers already sent' problem, but none of them fit my scenario.

    I am using a PHP script which grabs an HTML file for parsing. Ok, well I am manually adding another include into the HTML file via an external variable.

    Now, while I finally got the include to work, my included HTML file has some head code in it that makes it go all the way up to the top of the document, even though I actually have the include close to the end of the document.

    This is causing it to spit out "Cannot Send Headers...Headers alredy sent by [included file] on line 346 etc."

    Is there a way to tell the include's headers to 'wait' or something instead of loading FIRST?

    Any help will be appreciated.

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try placing ob_start(); at the very top of your script and ob_end_flush(); at the bottom, there was some tutorial on www.devshed.com about this if you need further information...
    - website

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2003
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid that method didnt work. I tried placing them on top and bottom of several of the files involved and they just gave me Invalid string errors.

  4. #4
    SitePoint Addict madproject.com's Avatar
    Join Date
    Jan 2003
    Location
    Ottawa, Canada
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you just remove the head info. in the HTML file. Because if you want it to load last it still doesn't matter.
    Free Picture and Video Hosting
    [http://photocabin.com][http://madproject.com]

  5. #5
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - website


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
  •