Reply to Re: Login via php code on an external page

Your name:

Reply:


Posted by J.O. Aho on 03/01/07 16:06

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация