Posted by zorro on 12/29/06 18:55
> zorro wrote:
> > it doesn't work :
> > curl_setopt($curl, CURLOPT_POSTFIELDS, array('clown'=>'bozo') );
Benjamin wrote:
> CURLOPT_POSTFIELDS only takes a string as it's parameter
I didn't find any specification stating that it takes a string
parameter.
http://www.php.net/manual/en/function.curl-setopt.php
There are dozens of examples where a string or an array is used and i
have also tried both successfully. The problem is only on this one
particular web site I'm posting to.
I need to use an array and not a string because for posting a file
upload one needs to use this syntax:
curl_setopt($curl, CURLOPT_POSTFIELDS,
array('mypic'=>"@path/to/image.gif") );
I tested that this works on my localhost and online testing server.
[Back to original message]
|