|  | Posted by fiziwig on 06/18/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] |