One last thing. If all you need to do is go to a page and not navigate it, you could just use HTTP_Request, upon which HTTP_Client is built. Then again, if you have multiple request to do and have to keep sending the auth data, the Client would be best.

David T-G wrote:

Justin, et al --

...and then Justin Patrin said...
% % You can use PEAR's HTTP_Client package % (http://pear.php.net/package/HTTP_Client) to connect to a website, do % authentication, post forms, handle redirects, etc. It also keeps track % of cookies.


Oh, goodie; that sounds great.


% % Here's a sample (note that the URLs in this will probably not work):
% % require_once('HTTP/Client.php');
% $client = &new HTTP_Client(array('user' => 'username', 'password' => % 'password'));


That certainly seems easy enough.


% $code = $client->post('http://www.example.com/script.asp', % array('var1' = 'val1', % 'VAR2' => 'val2'));

OK, so I don't actually need to navigate the page but instead just fill
in the fields and then send it.  Very cool.


% $code = $client->get('http://www.example.com/loginRequired.php');


Now to figure out how to try it out :-)


Thanks & HAND


:-D

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to