cURL
Haxx ad
libcurl
Automatically get a mirror near you





COMPARE PRICES:
Digital cameras, MP3 Players, Camcorders, Mobile phones, PDA, Computers, Electronics LCD monitors, Printers, Notebook, DVD Players, Motherboards, TV, ipod, Processors. See all...

Shopping cart software
Online collaboration software

SourceForge.net Logo

cURL > Mailing List > Monthly Index > Single Mail

curl-and-php mailing list Archives

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)

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/sf
Received on 2003-02-27

These mail archives are generated by hypermail.

donate! Page updated October 16, 2006.
web site info