[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    RE: [PHP] socket_read can not read the whole HTTP page?
From:       "Richard Lynch" <ceo () l-i-e ! com>
Date:       2007-12-31 1:12:21
Message-ID: 43484.98.193.37.55.1199063541.squirrel () www ! l-i-e ! com
[Download RAW message or body]

HTTP 1.1 requires more complex client/server interaction, and if your
client (which is about as brain-dead simple as it gets) isn't doing
that complex stuff, 1.1 will not work.

All HTTP 1.1 servers will work just fine with 1.0, so stick with that
unless you really NEED a feature of 1.1

On Fri, December 28, 2007 2:58 am, ked wrote:
> Wow, That's  correct answer!  Thank to Eddie Dunckley !
>
> scheme:
> $in .= "GET {$file} HTTP/1.0\r\n";  //-----------
> $in .= "Accept: text/html\r\n";
> $in .= "Accept-Language: zh-cn\r\n";
> $in .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
> .NET
> CLR 2.0.50727)\r\n";
> $in .= "Host: {$host}\r\n";
> $in .= "Cache-Control: no-cache\r\n";
> $in .= "Connection: closed\r\n\r\n";//------------must be "closed"
>
> 1.must be "HTTP/1.0"   : why? IE post  "HTTP/1.1" .
> 2. must be "closed" : so that should be close not closed;
>
> Both modification are required.
>
> Shall  anyone tell me sth. about "HTTP/1.0" and "HTTP/1.1" ?
>
> best regards!
> ked
>
>
>> -----Original Message-----
>> From: Eddie Dunckley [mailto:eddie@rttc.co.za]
>> Sent: Friday, December 28, 2007 3:50 PM
>> To: php-general@lists.php.net
>> Subject: Re: [PHP] socket_read can not read the whole HTTP page?
>>
>> On Fri 28 Dec 07, ked wrote:
>> > I wrote those script  to get HTTP url content, and it
>> works , but it
>> > can't read the whole content of the page.
>> > Blocked on "while ($out = socket_read($socket, 1024)) ".
>> > $in .= "GET {$file} HTTP/1.1\r\n";
>> try to change this to $in .= "GET {$file} HTTP/1.0\r\n";
>>
>> > $in .= "Connection: Keep-Alive\r\n\r\n";
>> and change this to
>> $in .= "Connection: closed\r\n\r\n";
>>
>> --
>> Eddie Dunckley - eddie@rttc.co.za - Realtime Travel
>> Connections IBE Development, www.rttc.co.za, cell
>> 083-379-6891, fax 086-617-7831 Where 33deg53'37.23"S
>> 18deg37'57.87"E Cape Town Bellville Oakdale ZA
>>        Chaos, panic, and disorder - my work here is done.
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To
>> unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic