cURL / Mailing Lists / curl-and-php / Single Mail


Re: Fake-referer and remote file-exist check & size-check usinglibcurl?...

From: Daniel Stenberg <>
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, "");
curl_setopt ($ch, CURLOPT_REFERER, "");
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 email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2003-02-27