How To Make A Request Using Digest Authentication with PHP


Php Code:
#!/usr/local/bin/php
<?php
$hCurl = curl_init();
curl_setopt($hCurl, CURLOPT_URL, 'http://example.com/myapp.php');
curl_setopt($hCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($hCurl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($hCurl, CURLOPT_USERPWD, 'myusername:mypass');

$data = curl_exec($hCurl);
curl_close($hCurl);
?>
 
_________________________
Russ Tanner
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch - Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com
The #1 Mercury-Amalgam Book
OneUp Domains - Low-Cost Domain Names and Hosting Plans
1-800-358-4278 (U.S. & Canada)
1-716-487-9502 (Worldwide)