Re: fopen https and login?
| From: | David Otton | Date: | Tue, 06 May 2003 01:14:50 +0000 |
| Subject: | Re: fopen https and login? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146480@lists.php.net to get a copy of this message | ||
On Mon, 5 May 2003 16:28:58 -0700 (PDT), you wrote:
>I can access the url directly (csv output) but it requires a login first.
>The login is in a form on the page and doesn't pass information in the
>url.
>
>Is there any way I can do this, I should I start investigating other
>ideas?
You need to submit the variables as a POST (multipart/form-data), rather
than a GET (url-encoded). A web search will throw up examples of POSTs,
or you can log what's happening between the site and your browser when
you log in with a proxy or a packet sniffer.
I'm guessing that you'll also have to hold a cookie from the site, too,
and retransmit it when you go to your data page.
Here's a class that can do it.... http://snoopy.sourceforge.net/
but it's just HTTP text - it's pretty easy to write your own.