Re: trouble with headers
| From: | Lars Torben Wilson | Date: | Wed, 13 Feb 2002 21:12:18 +0000 |
| Subject: | Re: trouble with headers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84647@lists.php.net to get a copy of this message | ||
On Tue, 2002-02-12 at 17:57, Erik Price wrote:
> Sorry, I debugged it myself.
>
> Don't add extra whitespace lines after you jump out of PHP mode (for
> instance, at the end of an include file, don't have any extra lines
> after the '?> PHP-jump-out mark'. The extra lines at the bottom of the
> functions include file was being interpreted as the end of the headers.
> (Man that book on HTTP I was reading at the library came in handy! Perl
> Web Client Programming or something)
>
> It isn't truly HTML since it isn't between the <html> and </html> tags,
> but it gets sent along as blank lines in the HTML document.
>
> That's my theory , anyway.
>
>
> Erik
You're right, but just a slight clarification:
Well, PHP isn't an HTML parser and has no concept of a DOM, or the
SGML-based nature of HTML, or anything like that (although there are
extensions which do this). Essentially, PHP generates a series of bytes,
which are output. In a web environment, this obviously means 'sent to
the browser', and typically implies HTML output. But you can also output
WML, csv, LDIF, or any other text-based format; or, for that matter,
binary data such as JPEG, GIF, PNG, or whatever. This means that PHP is
*required* to output whatever it is asked to--regardless of whether it
might look like HTML or not.
Hope this explains it,
Torben
--
Torben Wilson <torben@php.net>
http://www.thebuttlesschaps.com
http://www.hybrid17.com
http://www.inflatableeye.com
+1.604.709.0506