I have created one website using yii then tried create session using CURL but it is not working. I used following code:
<?php
$cSession = curl_init();
$username="admin";
$password='mypassword';
$url = "localhost/mysite/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
//echo $result;
?>
Please help me…