I want source from a page so I was using file_get_contents(), but it comes back as Unathorized Access, because it needs a username and password to access the page. Last night I found a way to do with cURL, but if there is a simpler method, that would be nice.
[PHP]
$url = 'http://url.goes.here.com';
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
curl_setopt($ch, CURLOPT_MUTE, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$result=curl_exec ($ch);
curl_close ($ch);
[/PHP]
Everything comes back in $result, I may have a few extra curl_setopt() but it works.
Jason