> -----Original Message-----
> From: John Luxford [mailto:[EMAIL PROTECTED]
> Sent: 26 June 2003 16:44
> 
> I'm having a really strange output problem that I can't figure out.  
> The problem is that a few characters appear prepended and appended to 
> the body of the server response.  I'm running PHP 4.3.0 and 4.3.2 on 
> Mac OS X (tibook and xserve) and Red Hat 7.1 with 4.3.2 as well, with 
> Apache 1.3 on all of them.
> 
> Here is a reproduction of the problem on two servers:
> 
>  From the command line... (the following URL illustrates the problem, 
> feel free to use it)
> 
> (Request)
> $ telnet dev.ourvoices.ca 80
> GET /test.php HTTP/1.1
> Host: dev.ourvoices.ca
> 
> (Response)
> HTTP/1.1 200 OK
> ...other headers...
> Content-Type: text/html
> 
> 3
> foo
> 0
> 
> (The code in /test.php)
> <?php echo 'foo'; ?>
> 
> (What's with the 3 and the 0)

This is HTTP Chunked transfer encoding.  Practically all browsers around
these days understand this, and will correctly render the above as just 

foo

(The technical details are that output is sent as a series of chunks
consisting of the chunk length followed by that many bytes.  A chunk length
of 0 indicates the end of the data.)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

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

Reply via email to