curl-and-php
Re: Fake-referer and remote file-exist check & size-check usinglibcurl?...
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 27 Feb 2003 16:28:28 +0100 (CET)
Date: Thu, 27 Feb 2003 16:28:28 +0100 (CET)
On Thu, 27 Feb 2003, Fernando Cassia wrote:
> And how do I do a http-get request with a fake referer and custom
> user-agent? Care to post an example?
(We're making history here, I'm actually writing PHP!)
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.nowhere.com/");
curl_setopt ($ch, CURLOPT_REFERER, "http://www.somewhere.com/");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla 2003, that coolish version");
curl_exec ($ch);
curl_close ($ch);
But hey, you might want to store the received data somewhere too or similar,
but I figure you get the basics here...
-- Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2003-02-27