note 83549 added to curl.examples
| From: | jlee8df at gmail dot com | Date: | Sat, 31 May 2008 03:21:22 +0000 |
| Subject: | note 83549 added to curl.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140024@lists.php.net to get a copy of this message | ||
Update to my previous code:
For every return statement, call "curl_close($ch);" or "fclose($fp);"
or both to pair up "curl_init()" and/or "fopen()".
For example:
<?php
// ...
// this statement:
// if( !curl_setopt($ch, CURLOPT_URL, $url) ) return "FAIL: curl_setopt(CURLOPT_URL)";
// should be:
if( !curl_setopt($ch, CURLOPT_URL, $url) )
{
fclose($fp); // to match fopen()
curl_close($ch); // to match curl_init()
return "FAIL: curl_setopt(CURLOPT_URL)";
}
// ...
?>
- JLèé
----
Server IP: 69.147.83.197
Probable Submitter: 122.53.223.92
----
Manual Page -- http://www.php.net/manual/en/curl.examples.php
Edit -- https://master.php.net/note/edit/83549
Del: integrated -- https://master.php.net/note/delete/83549/integrated
Del: useless -- https://master.php.net/note/delete/83549/useless
Del: bad code -- https://master.php.net/note/delete/83549/bad+code
Del: spam -- https://master.php.net/note/delete/83549/spam
Del: non-english -- https://master.php.net/note/delete/83549/non-english
Del: in docs -- https://master.php.net/note/delete/83549/in+docs
Del: other reasons-- https://master.php.net/note/delete/83549
Reject -- https://master.php.net/note/reject/83549
Search -- https://master.php.net/manage/user-notes.php