
08.01.2008, 01:01
|
|
Познающий
Регистрация: 01.01.2008
Сообщений: 50
Провел на форуме: 187422
Репутация:
71
|
|
Сообщение от NOmeR1
[alfred], но так контент будет выводится, а не записываться в переменную.
Сообщение от php.net
Note:
If you want to have the result returned instead of it being printed to the browser directly, use the CURLOPT_RETURNTRANSFER option of curl_setopt().
Соответственно правим код на
PHP код:
<?
$cU = curl_init('http://www.example.com/');
curl_setopt($cU, CURLOPT_COOKIE, "cookis_one=1; cookis_two=2;");
curl_setopt($cU,CURLOPT_RETURNTRANSFER,true);
$content = curl_exec($cU);
curl_close($cU);
?>
И получаем желаемый результат
|
|
|