I've searched everywhere on the web, but so far I can not understand what's going wrong with my code.
I'm trying to access my student's portal from my college, using cURL, my interest is to get the grades of each student to be served to other means.
My problem is when I log in because I am passing the user data and password, but it is not authenticated and it seems to me that it is not generating an authentication cookie.
I put the code I'm using and then image the head of the college page and the page running locally.
What I want to receive is the page that displays the notes, but I can not even pass the login page.
$url="http://179.189.22.226/corpore.net/Login.aspx";
$cookie="cookie.txt";
$postdata = "txtUser=aquiUsuario&txtPass=aquiSenha&ddlAlias=CorporeRM&btnLogin=Acessar";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_URL, 'http://179.189.22.226/corpore.net/Main.aspx?ShowMode=2&SelectedMenuIDKey=');
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
echo $result;
curl_close($ch);