Hello,
On 09/13/2004 05:21 PM, [EMAIL PROTECTED] wrote:
I noticed some numbers mixed with the response generated by my PHP code, and I can't figure out what's causing it. I've dumbed my PHP script down to just this (what could be simpler?):
<?php echo "testing"; ?>
And I monitor the HTTP response coming from the server (apache), it looks like this:
HTTP/1.1 200 OK Date: Mon, 13 Sep 2004 20:03:21 GMT Server: Apache/2.0.44 (Unix) PHP/4.3.1 Accept-Ranges: bytes X-Powered-By: PHP/4.3.1 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1
7 testing 0
Note the "7" and the "0". After some experimenting I believe the first number is the length of the body, then there's the body, and finally a 0 at the end. What gives? How to I get rid of these numbers?
I'm running on linux. The software versions are in the HTTP headers but in case you missed them, apache 2.0.44 and PHP 4.3.1.
Those numbers are part of the chunked transfer encoding of HTTP 1.1.
You may want to take a look at this HTTP client class to see how they should be interpreted to read this kind of HTTP encoded response.
http://www.phpclasses.org/httpclient
--
Regards, Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php