cURL login problem for a licensed webpage [message #175547] |
Thu, 06 October 2011 12:23 |
tokiyashi
Messages: 2 Registered: October 2011
Karma:
|
Junior Member |
|
|
Hey guys, i'm writing a simple code piece to create a little
application for our university and i need to login our university's
data management system.
I wrote code below there, i don't know what is going wrong. login.aspx
page includes the login form. dashboard.aspx is what i want to get.
$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_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_exec($ch);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_URL, 'http://bys.marmara.edu.tr/
dashboard.aspx');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($ch);
echo $page;
with best regards,
Çağlar Bozkurt / tokiyashi
|
|
|