note 31098 added to ref.curl
| From: | sorin at rack1 dot php dot net | Date: | Wed, 09 Apr 2003 18:44:26 +0000 |
| Subject: | note 31098 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46421@lists.php.net to get a copy of this message | ||
function curl_string ($url,$user_agent,$proxy){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "c:\cookie.txt");
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$url_page = "http://www.google.com/";
$user_agent = "Mozilla/4.0";
$proxy = "http://208.25.243.167:8080";
$string = curl_string($url_page,$user_agent,$proxy);
echo $string;
this could hep someone
Sorin
--
http://www.php.net/manual/en/ref.curl.php
http://master.php.net/manage/user-notes.php?action=edit+31098
http://master.php.net/manage/user-notes.php?action=delete+31098
http://master.php.net/manage/user-notes.php?action=reject+31098