It is called basic-auth and works with most browsers, including curl on the command line:
curl --user name:password http:
and in PHP you set two parameters for your curl connection ($ curl_conn):
curl_setopt($curl_conn, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl_conn, CURLOPT_USERPWD, 'username:password');
source share