$cookie_box = dirname(__FILE__).'/cookies/'.$login.'_gettpartner_cookie.txt'; $curl = curl_init(); curl_setopt($curl, CURLOPT_COOKIESESSION, 1); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_box); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_box); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_USERAGENT, "Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0"); curl_setopt($curl, CURLOPT_URL, 'http://gettpartner.ru/index.php'); $h = curl_exec($curl); $a = explode('name="_token" value="', $h); $b = explode('">', $a[1]); $token = $b[0]; $common_gett = curl_init('http://gettpartner.ru/'); curl_setopt($common_gett, CURLOPT_COOKIESESSION, 1); curl_setopt($common_gett, CURLOPT_REFERER, 'http://gettpartner.ru/'); curl_setopt($common_gett, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($common_gett, CURLOPT_POST, 1); curl_setopt($common_gett, CURLOPT_POSTFIELDS,"_token=$token&email=$login&password=$pass"); curl_setopt($common_gett, CURLOPT_HEADER, 1); curl_setopt($common_gett, CURLOPT_USERAGENT, "Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0"); curl_setopt($common_gett, CURLOPT_RETURNTRANSFER, 1); curl_setopt($common_gett, CURLOPT_COOKIEJAR, $cookie_box); curl_setopt($common_gett, CURLOPT_COOKIEFILE, $cookie_box); curl_setopt($common_gett, CURLOPT_FOLLOWLOCATION, 1); $h = curl_exec($common_gett); $common_gett = curl_init('http://gettpartner.ru/fleet/drivers'); curl_setopt($common_gett, CURLOPT_COOKIESESSION, 1); curl_setopt($common_gett, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($common_gett, CURLOPT_REFERER, 'http://gettpartner.ru/'); curl_setopt($common_gett, CURLOPT_POST, 0); curl_setopt($common_gett, CURLOPT_HEADER, 1); curl_setopt($common_gett, CURLOPT_USERAGENT, "Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0"); curl_setopt($common_gett, CURLOPT_RETURNTRANSFER, 1); curl_setopt($common_gett, CURLOPT_COOKIEJAR, $cookie_box); curl_setopt($common_gett, CURLOPT_COOKIEFILE, $cookie_box); curl_setopt($common_gett, CURLOPT_FOLLOWLOCATION, 1); $html = curl_exec($common_gett); |