note 58006 added to ref.curl

From: Date: Fri, 21 Oct 2005 11:18:30 +0000
Subject: note 58006 added to ref.curl
Groups: php.notes 
Request: Send a blank email to php-notes+get-97346@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/ref.curl.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58006 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58006&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58006&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#97346) next »