我有一个脚本
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com");
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.yandex.ru/');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_MAXREDIRS, 30);
$data = curl_exec($ch);
echo "$data";
curl_close($ch);
?>
它输出一个变量,它包含一个标题列表,包括Location和SetCookie。我希望我的浏览器通过Header功能运行它们。我怎么能这样做?