note 117517 deleted from function.curl-init by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:47:06 +0000 |
| Subject: | note 117517 deleted from function.curl-init by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215306@lists.php.net to get a copy of this message | ||
Note Submitter: ageesen at videro dot com
----
Curl_init as well as CURLOPT_URL don't like to have static strings as parameter.
I came across this by accident and it took me very long to find out. curl_exec will throw error 3
(Malformed) and you tipple check the URL in it's variable only to find by trial and error that
it's declaration is the culprit.
So never do this:
static $someurl = "http://www.example.com/interfacce.php";
....
$ch=curl_init($someurl);
....
$return=curl_exec($ch);
Cheers