Опишу суть проблемы. Авторизуюсь на сайте первым запросом, проверяю по ob_get_contents - авторизовался. Далее нужно отправить POST запрос. Но в выдаче ob_get_contents - страница с просьбой авторизоваться. Куки сохраняются в файл - проверял. Для безопасности сменил пароль и логин. Если будет желание помочь - кину пароль с логином в личку. Сохранял логи и делал через har2php.sharecoder.com - создает php на основе логов. Чувствую, что ошибка где-то в нескольких заголовках. Заранее огромное спасибо!!! Вот как код: PHP: $cookie_file = $_SERVER['DOCUMENT_ROOT'].'/offers/cookies_teztour.txt'; $ch = curl_init(); $teztour_login="LOGIN"; $teztour_passwd="PASS"; $host = "online.teztour.com"; $url = "/UserServer/login.htm"; curl_setopt($ch, CURLOPT_URL, 'http://'.$host.$url); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2'); curl_setopt($ch, CURLOPT_REFERER, 'http://online.teztour.com/UserServer/index.htm?ref=http%3A%2F%2Fonline.teztour.com%2Farmmanager%2F'); curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate'); сurl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $header = array(); $header[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; $header[] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7'; $header[] = 'Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3'; $header[] = 'Pragma: '; curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, true); $fields = array(); $fields[] = 'j_password='.$teztour_passwd; $fields[] = 'j_username='.$teztour_login; $fields[] = 'ref=http://online.teztour.com/armmanager/'; $fields[] = 'submit=Войти / Sign in'; curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $fields)); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_HEADER, 1); ob_start(); $result = curl_exec($ch); $html_result = iconv('UTF-8', 'windows-1251', ob_get_contents()); ob_end_clean(); var_dump($html_result); curl_setopt($ch, CURLOPT_URL, 'http://online.teztour.com/armmanager/workplace/search/getResult'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2'); curl_setopt($ch, CURLOPT_REFERER, 'http://online.teztour.com/armmanager/workplace/section/tour-search'); curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate'); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, true); $fields = array(); $fields[] = 'accommodationId='.$price['room']; $fields[] = 'after='.$price['depature_date']; $fields[] = 'before='.$price['depature_date']; $fields[] = 'cityId='.$price['city_from']; $fields[] = 'countryId='.$price['country']; $fields[] = 'currency='.$price['currency']; $fields[] = 'hotelClassBetter=true'; $fields[] = 'hotelClassId=2567'; $fields[] = 'hotelId='.$price['hotel']; $fields[] = 'hotelInStop=true'; $fields[] = 'locale=ru'; $fields[] = 'nightsMax='.$price['days']; $fields[] = 'nightsMin='.$price['days']; $fields[] = 'noTicketsFrom=false'; $fields[] = 'noTicketsTo=false'; $fields[] = 'priceMax='.$price['price']; $fields[] = 'priceMin='.$price['price']; $fields[] = 'rAndBBetter=true'; $fields[] = 'rAndBId=15350'; $fields[] = 'specialInStop=undefined'; $fields[] = 'tourId='.$price['city_to']; $fields[] = 'tourType=1'; $fields[] = 'version=2'; curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $fields)); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); ob_start(); $result = curl_exec($ch); $html_result = iconv('UTF-8', 'windows-1251', ob_get_contents()); ob_end_clean(); curl_close($ch); var_dump($html_result);