Two stage curl authentification
Posted: Fri Jan 01, 2010 2:59 pm
Hi,
I have to use curl to connect to a website that is using .htaccess and than https. I would like to know how I would go about in to include both authentication?
Here is the first part of the code:
This part works great for the htaccess login. But once I try to connect to the https, the htaccess fails.
Thx
I have to use curl to connect to a website that is using .htaccess and than https. I would like to know how I would go about in to include both authentication?
Here is the first part of the code:
Code: Select all
<?php
$url = "https://mydomain.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "login:password");
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookiedb');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookiedb');
$result = curl_exec($ch);
curl_close($ch);
?>
Thx