Re: Login via php code on an external page
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Thu, 01 Mar 2007 17:06:42 +0100
Andrea wrote:
It's a lot easier if you use wget, it supports sessions and cookies, you first
use wget to get the page to your local machine and then process the file in php.
Well...but how to login via wget???
I guess it's a normal form, password and login that is sent and that is usually done with a POST, so you will need to use the --post-data option, you may want to lie that you are using a browser, in that case you use --user-agent. For the session cookie you need to use the --save-cookies option
You use the wget once for the login and then once for fetching the page you wanted.
For further information, I suggest you take a look at the wget man page:
man wget
Simple example from the man page:
get --save-cookies cookies.txt --post-data 'user=foo&password=bar' http://server.com/auth.php
wget --load-cookies cookies.txt -p http://server.com/interesting/article.php
--
//Aho
.
- Follow-Ups:
- Re: Login via php code on an external page
- From: Andrea
- Re: Login via php code on an external page
- References:
- Login via php code on an external page
- From: Andrea
- Re: Login via php code on an external page
- From: J.O. Aho
- Re: Login via php code on an external page
- From: Andrea
- Login via php code on an external page
- Prev by Date: Re: query string passing woes........ help... please....
- Next by Date: Re: Login via php code on an external page
- Previous by thread: Re: Login via php code on an external page
- Next by thread: Re: Login via php code on an external page
- Index(es):
Relevant Pages
|
|