Re: content-length: HTTP1.0 ok., but HTTP1.1, virtual hosts?
| From: | Sascha Schumann | Date: | Wed, 26 Jul 2000 15:23:31 +0000 |
| Subject: | Re: content-length: HTTP1.0 ok., but HTTP1.1, virtual hosts? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-26312@lists.php.net to get a copy of this message | ||
On Wed, 26 Jul 2000, waldschrott wrote:
> Hi there,
> this is the code to retrieve the content-length on given item.
> Unfortunately I had no success using virtual hosts or HTTP1.1.
> Could sb. lend his helping brain? :)
>
> regards
>
> Example with file on local server, php.net and heavy.com...
>
> <?php
> include('dao/package.IOSocket.php');
> function &content_length($server,$path,$port=80) {
> $io = new IOSocket($server,$port);
> $io->open();
> $io->send("GET $path HTTP/1.0\n");
You should send a HEAD request.
Also note that the line delimiter is CRLF.
> echo content_length('www.heavy.com','/');
> echo content_length('www.php.net','/');
These are probably both dynamic sites which don't return a
Content-Length header.
- Sascha