Re: fopen - how to get a site with login
On Thu, 28 Feb 2008 12:46:57 +0100, Feijó <afeijo@xxxxxxxxx> wrote:
I need to get some pages from a site that request user and passw
Probably they use cookies
How can I do that?
CURL is your friend:
http://nl2.php.net/curl
Especially read about the options set with curl_setopt()
If CURL isn't installed at your server, you'll either have to write your
own lofic using fsockopen(), and manually write & read (/interpret)
headers, or use one of the http client classes out there, for instance the
PEAR one: <
http://pear.php.net/package/HTTP_Client>
--
Rik Wasmus
.
Relevant Pages
- Re: http-access2 multi-part from upload
... also, and this of off-topic but important, i had three different versions of curl and all three required different command line flags to get going, with only two versions being able to actually upload to rubyforge due to a bug in cookied handling. ... in the first case the cookies are not sent to the client and the cookie file ... (comp.lang.ruby) - Re: [PHP] libcurl (cookies across cURL session). . .?
... Is there any way at all by which to persist cookies across cURL ... Basically I have a login page that sets cookies and looks ... | such as forms, properties, sessions, and caches. ... (php.general) - RE: [PHP] Curl and cookies
... Set option "HEADER" true for the login part in Curl ... Make a new call to a new page, using the cookies with curl option COOKIE. ... (php.general) - Re: [PHP] Curl redirection problem.
... But bear in mind that any cookies you've set up with curl will not be ... there when you redirect the client since they're in your cookie jar not ... If all you want to do is log them in using a username and password that you have simply fake the login form from the other site on your page with hidden text fields, auto-fill it with the details and set the action to the same place the login form on the other site submits to. ... (php.general) - Re: CURL form posting to self referencing form action
... > point CURL to the action target to pass form data. ... This is odd because Curl is supposed to do collect any cookies. ... PHP Classes - Free ready to use OOP components written in PHP ... PHP Reviews - Reviews of PHP books and other products ... (comp.lang.php) |
|