[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Получить урл/домен страницы курлом с редиректом
mstdmstd
Всем привет,
Получаю содержимое страницы курлом с опциями
$this->curlOptions = Array(
CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data
CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers
CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers
CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out
CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries
CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow
);

$this->curlOptions[CURLOPT_URL]= $url;
curl_setopt_array($ch, $this->curlOptions); // Setting cURL's options using the previously assigned array data in $this->curlOptions

$data = curl_exec($ch);

При этом скачиваемая страница редиректит на другую страницу ...
Как получить урл/домен страницы с содержимым?

Спасибо!
killer8080
$redirect_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.