note 107628 added to curl.examples-basic
| From: | hoang92bn at gmail dot com | Date: | Wed, 22 Feb 2012 15:33:46 +0000 |
| Subject: | note 107628 added to curl.examples-basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186280@lists.php.net to get a copy of this message | ||
<?php
function getcontent($surl)
{
$header_array[0] = "Keep-Alive: 30000";
$header_array[1] = "Connection: Keep-Alive";
$header_array[2] = "Expect:";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)";
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL,$surl);
curl_setopt($ch1, CURLOPT_HEADER,0);
curl_setopt($ch1, CURLOPT_HTTPHEADER,$header_array);
curl_setopt($ch1, CURLOPT_USERAGENT,$agent);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch1,CURLOPT_CONNECTTIMEOUT,"1200");
curl_setopt($ch1, CURLOPT_COOKIEFILE,'cookie.txt');
$result1= curl_exec($ch1);
curl_close ($ch1);
return $result1;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 58.187.110.207
----
Manual Page -- http://www.php.net/manual/en/curl.examples-basic.php
Edit -- https://master.php.net/note/edit/107628
Del: integrated -- https://master.php.net/note/delete/107628/integrated
Del: useless -- https://master.php.net/note/delete/107628/useless
Del: bad code -- https://master.php.net/note/delete/107628/bad+code
Del: spam -- https://master.php.net/note/delete/107628/spam
Del: non-english -- https://master.php.net/note/delete/107628/non-english
Del: in docs -- https://master.php.net/note/delete/107628/in+docs
Del: other reasons-- https://master.php.net/note/delete/107628
Reject -- https://master.php.net/note/reject/107628
Search -- https://master.php.net/manage/user-notes.php