Есть очень умный курл, есть вот такое документированное использование передачи COOKIE Код (Text): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_COOKIE,"НАША КУКА"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); $result = curl_exec($ch); curl_close($ch); Вопрос как передать две куки? Вот так вот работать отказывается (( Код (Text): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_COOKIE,"НАША КУКА"); curl_setopt($ch, CURLOPT_COOKIE,"НАША КУКА2"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); $result = curl_exec($ch); curl_close($ch);
Проблему решил )) Вот решение проблемы: Код (Text): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); $result = curl_exec($ch); curl_close($ch); Объясняю как работает: Код (Text): curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); Подставляет куки имеющиеся в файле Код (Text): curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); Записывает нужные куки в файл З.Ы. файл ОБЯЗАТЕЛЬНО должен быть открыт на чтение и запись, лучше всего поставить на него права 777