RE: Spurious newlines when requesting empty php file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Carl Michael Skog wrote:
> If I save the response of this command with lynx (lynx -dump
> "http://www.formatemp.com/catalog/paynova-reply.php"; > somefile),
> I will get three newlines.

Aha! I knew it. :)  See:

http://marc.theaimsgroup.com/?l=php-general&m=110272197009025&w=2

Lynx adds the newlines.  Better to use Links instead for this sort of thing.

> If I request this file in a browser and scrutinize the response
> packet in a packet analyser, I see something fishy.
>
> After the usual header fields part are closed with the usual double
> "\r\n" sequence, a "new" header is added, consisting of the character
> "0".
> This is the then closed with the double "\r\n" sequence.

Yes, I've noticed that too, using Ethereal to capture packets.  Try this
with a php file that produces output.  If you capture the packet you'll see
that the output is preceded by a hexidecimal number and followed by "0".
The first hex number is the number of characters in the output.  This does
not happen with plain HTML files, at least not on my test machine.

> Obviously, this is part of the data part of the package, and possibly
> becomes the three newlines I am observing.

No...that's Lynx's fault.

> What does this "extra" header value come from ?

Aha, just found it:

http://www.apps.ietf.org/rfc/rfc2616.html#sec-3.6.1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux