я выборка somesite страница .., как я могу установить куки в завиток
но не отображать ничего и изменения URL-адреса.
примера я напечатал
http://localhost/sushant/EXAMPLE_ROUGH/curl.php
в завиток странице моей кодировка =
$fp = fopen("cookie.txt", "w");
fclose($fp);
$agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
// 2. set the options, including the url
curl_setopt($ch, CURLOPT_URL, "http://www.fnacspectacles.com/place-spectacle/manifestation/Grand-spectacle-LE-ROI-LION-ROI4.htm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
// 3. execute and fetch the resulting HTML output
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
echo $output = curl_exec($ch);
// 4. free up the curl handle
curl_close($ch);
но canege URL-адрес, как это ..
http://localhost/aide.do?sht=_aide_cookies_
объект не найденный.
, как можно решить эти проблемы помогают мне
Я не понимаю, что делает «cookie.txt». Сделать ошибки показать с помощью: 'error_reporting (E_ALL);' –
В чем именно ваш вопрос? Что не работает? –
Не совсем уверен, почему VolkerK вернул мое редактирование ... –