June 25, 2006

Using Curl to get file contents

Short and sweet php script to get the file contents on a web page on another site.

$link_page = "http://www.example.com/";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link_page);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec ($ch);
curl_close ($ch);

print_r($result);
?>

Share:These icons link to social bookmarking sites where readers can share and discover new web pages.
    del.icio.us digg Fark YahooMyWeb Reddit blinkbits BlinkList blogmarks co.mments connotea De.lirio.us feedmelinks Furl LinkaGoGo Ma.gnolia NewsVine Netvouz RawSugar scuttle Shadows Simpy Smarking Spurl TailRank Wists
Filed under Web by admin.
Permalink • Print • 

Leave a comment