Why doesn’t CURL authorize on https://kabinet_dot_3ton_dot_eu ?
such a function
function login($url,$login,$pass){ $ch = curl_init(); if(strtolower((substr($url,0,5))=='https')) { // если соединяемся с https curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); } curl_setopt($ch, CURLOPT_URL, $url); // откуда пришли на эту страницу curl_setopt($ch, CURLOPT_REFERER, $url); // cURL будет выводить подробные сообщения о всех производимых действиях curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"wizard[username]=".$login."&wizard[password]=".$pass); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (Windows; U; Windows NT 5.0; En; rv:1.8.0.2) Gecko/20070306 Firefox/1.0.0.4"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //сохранять полученные COOKIE в файл curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/cookie.txt'); $result=curl_exec($ch); // Убеждаемся что произошло перенаправление после авторизации if(strpos($result,"Location: gsm-platby-sim.html")===false) die('Login incorrect'); curl_close($ch); return $result; } $url="https___centrum_dot_3ton_dot_eu"; $login="asd"; $pass="asd"; echo login($url,$login,$pass); Instead of letters in the password you need to substitute the numbers
I must say that the code can not be changed on the site.
curl_error($ch);what returns? - cyadvert