Re: cURL login problem for a licensed webpage [message #175548 is a reply to message #175547] |
Thu, 06 October 2011 12:37 |
tokiyashi
Messages: 2 Registered: October 2011
Karma:
|
Junior Member |
|
|
I added license too, but still not working.
$url = "https://bys.marmara.edu.tr/login.aspx";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
CURLOPT_POSTFIELDS,'txtLogin='.urlencode($username).'&txtPassword='.url encode($password));
//curl_setopt($ch, CURLOPT_POSTFIELDS,'txtLogin='.
$username.'&txtPassword='.$password);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CAINFO, "./bys-license.crt");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows
NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_exec($ch);
curl_close($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_URL, 'http://bys.marmara.edu.tr/
dashboard.aspx');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
|
|
|