Re: PHP libraries? Function to open remote http doc
| From: | David Otton | Date: | Wed, 13 Dec 2000 22:46:22 +0000 |
| Subject: | Re: PHP libraries? Function to open remote http doc | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30203@lists.php.net to get a copy of this message | ||
On Wed, 13 Dec 2000 09:31:47 -0800, you wrote:
>redirections (effectively, I have to proxy the request and parse the
>results before passing them back to the user). I've written a real kludge
>of a function that does basically what I need (sort of like fopen, but
>read-only and with an optional headers field so the caller can pass it
I did the same thing - fopen the page, read the headers in, check for
error messages and parse Location: headers. Like you say, it's icky.
>httpd auth and cookies and what-not), but I can't help but think that this
>sort of function is something which should have been needed by countless
>others already and that someone has already written a complete implementation.
>Perhaps there's a library which incorporates such a function?
It's called a web browser... how about spawning lynx and asking it for
the source of the page on stdout? It should deal with the redirect
stuff for you... not sure about the cookie though - I don't have a
copy installed. Does anyone know if Lynx can accept a custom header as
a command-line argument?
djo