cURL / Mailing Lists / curl-users / Single Mail

curl-users

Is it Curl or PHP that's the problem?

From: Thomas Deliduka <thomas_at_neweve.com>
Date: Thu, 19 Oct 2000 10:22:55 -0400

I just updated to curl 4.7.1 and PHP 4.0.3

I have this php script I have been working on today and it doesn't work so I
made a test script. The problem is that the CURLOPT_REFERER option doesn't
seem to work.

When I run this script:

$file = fopen("thisfile.txt", "w");
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FILE, $file);
curl_setopt($ch, CURLOPT_URL, "http://www.fromtheduke.com/testing.phtml");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.75 (Macintosh; U; PPC)");
curl_setopt($ch, CURLOPT_REFERER, "http://www.fromtheduke.com/test.phtml");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "jones=jones");
curl_exec ($ch);
curl_close ($ch);
fclose ($file);

The verbose output is this:

* Connected to fromtheduke.com (216.235.251.85)
> POST /testing.phtml HTTP/1.0
User-Agent: Mozilla/4.75 (Macintosh; U; PPC)
Host: www.fromtheduke.com:80
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

jones=jones

Notice, nowhere in there does it give the referer.

The results of the test.phtml file is this:

Referer:
Browser: Mozilla/4.75 (Macintosh; U; PPC)

Now, The script I need this to work with is for an e-commerce charging site
and it needs a valid referer before It can work. Is this a bug in Curl or
in PHP?

-- 
Thomas Deliduka
IT Manager
     -------------------------
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.com/
Received on 2000-10-19