RE: [PHP] OT http protocol question & another http question
| From: | Jason Murray | Date: | Mon, 28 Aug 2000 23:56:38 +0000 |
| Subject: | RE: [PHP] OT http protocol question & another http question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14017@lists.php.net to get a copy of this message | ||
> This isn't an answer as that seems to have been taken care of, but say I
> have a web page that fetches another web page, ie does a fsockopen and
then
> reads in another page. What happens when the header fetched from the other
> site has something along the lines of
>
[snip]
> Connection: Keep-Alive
>
> The header Connection Keep-Alive appears to be causing me trouble. Will I
> have to not close the socket and just keep reading and waiting for the
site
> to send me more text ? I thought http was open, send request, receive
> response, close each time ?
HTTP 1.1 allows a connection to stay alive, and request more files.
One thing you may have problems with here is the fact that the remote server
is trying to set a cookie. You'll also have problems if you get redirected.
Solution? Use an external program to grab the remote page - I like cURL,
you can get it from http://curl.haxx.se/. :)
Jason