How to set the PHP_AUTH_PW and PHP_AUTH_USER parameters in php curl.
At the server end its checking for:
if(!isset($_SERVER['PHP_AUTH_PW'])) { print "Authorization error" }
Any help would be appreciated
Thanks
It is called basic-auth, and works with most browsers including curl on command line:
curl --user name:password http://www.example.com
and in PHP you set two options on your curl connection ($curl_conn):
curl_setopt($curl_conn, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl_conn, CURLOPT_USERPWD, 'username:password');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With