Chris Ditty wrote:
I am trying to write a small module to display my gmail email on my custom
startup page.  I am using this url with the correct userid and password -
https://USERNAME:[EMAIL PROTECTED]/gmail/feed/atom .

When I put it in the web browser, it acts like it is supposed to. But when
I try and script it, it returns a 401 unauthorized error.  I get the same
error when I try a wget also.

Has anyone had any success in getting this to work from a script?  The
output is supposed to be simple RSS once I get past this error.


I'm only guessing, but you probably need to set the http Authorization
header in the request. If you are using curl, do something like:
   curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
   curl_setopt($curl, CURLOPT_USERPWD, "USERNAME:PASSWORD");

Check out wget's --http-user and --http-password options too.

Ryan

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

Reply via email to