You are here: Re: Basic Authentication problem « PHP Programming Language « IT news, forums, messages
Re: Basic Authentication problem

Posted by fiziwig on 12/02/83 11:52

Jerry Stuckle wrote:
<snip>
>
> 'Authorization: Basic '.base64_encode("username:password")."\r\n"
>
> Are you putting your real username and password in here?
>
> Also, don't know if it makes a difference - but I normally put the authorization
> header just before the content type.
>
> If you're running Firefox, you can get the Live HTTP Headers extension for it.
> Print out your header and compare it to what you get when you try to access the
> page with Firefox. You should be able to see what the difference is.
>

Yes, I am using the real username and password.

FWIW: This alternate approach DID work:

$url = 'http://XXXXXXX.com/ModWebservice/PostServer/';
$url .= '?service=AddProspect&modifiers[responder][0]='.$list_name;
$url .= '&modifiers[email]='.$email;
$url .= '&modifiers[name]='.urlencode($first_name.' '.$last_name);
$url .= '&modifiers[ip]='.$ip;
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// grab URL and pass it to the browser
$response=curl_exec($ch);

// close CURL resource, and free up system resources
curl_close($ch);

Thanks for all the suggestions.

--gary

 

Navigation:

[Reply to this 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

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