note 58006 rejected from ref.curl by betz
| From: | betz@php.net | Date: | Fri, 21 Oct 2005 12:32:45 +0000 |
| Subject: | note 58006 rejected from ref.curl by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97349@lists.php.net to get a copy of this message | ||
Note Submitter: the12k_now at yahoo dot com
----
CAUTION: Be weary about using cURL over fopen and fread for HTTP, FTP, or remote files.
As sellchain indicated in the previous post, cURL is faster, but it's not as reliable.
Run the code below using the specified url:
<?php
$url = 'http://www.marketbanker.com/mb/' .
'commerce/purchase_form.php?opid=9201&afsid=1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
echo $contents;
?>
While cURL works perfectly well with many urls, I was surprised to find that it
didn't work for the url specified in the above script.
So I'd have to say that cURL really isn't all that reliable.
I'll look around a bit to see if I can identify a pattern of this behavior with
cURL and will post an update if I find more info.
BTW: I had to concatenate the url in order to post the message on this board.