Re: Login via php code on an external page



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
.



Relevant Pages

  • Re: Login via php code on an external page
    ... use wget to get the page to your local machine and then process the file in php. ... Well...but how to login via wget??? ...
    (alt.php)
  • [SLE] Wget
    ... I wish all a nice hollyday. ... I can get wget to login with user and passwd via cookies.txt ... but not the newone her. ...
    (SuSE)
  • Re: SU and Login source code for FC2
    ... >This way I really need Login and SU pam aware source codes to recompile ... Find the packages the files you're after belong to: ... $ rpm -qf `which login` ... $ wget \ ...
    (comp.os.linux.misc)
  • wget for archiving Yahoo Mail and Groups?
    ... I've been trying to make wget download my Yahoo Mail and Group message ... I've used wget before on regular, no login sites without any problem. ...
    (comp.os.linux.networking)
  • wget for archiving Yahoo Mail and Groups?
    ... I've been trying to make wget download my Yahoo Mail and Group message ... I've used wget before on regular, no login sites without any problem. ...
    (comp.os.linux.misc)