I am trying to get some value form outside website which need username and password.
normally I need go to login page first(https://xxx.xxx.xxx/HomeAccess), then go to https://xxx.xxx.xxx/xxx.aspx. But if without login just go to the page xxx.aspx, I will get errror "The page cannot be displayed because an internal server error has occurred.";
in PHP I'm trying use this code
$ch = curl_init();
$url = 'https://xxx.xxx.xxx/xxx.aspx';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
I got blank page.
Any idea? thanks
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)