Hi everyone , I'm trying to login to a site and it does not work , I don't see the problem ..
$user = 'user';
$pass = 'pass';
$url = 'http://ecat.elit.ro/Default.aspx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POSTFIELDS,
'ctl00$ContentPlaceHolder1$LoginControl$tbLoginUser='.urlencode($user).'&ctl00$ContentPlaceHolder1$LoginControl$tbLoginPass='.urlencode($pass).'&ctl00$ContentPlaceHolder1$LoginControl$btnLogin=Intrare');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
echo $res;
Thank's in advance!