|
Posted by Andy Hassall on 11/02/91 11:31
On 9 Nov 2005 08:55:31 -0800, "Wescotte" <wescotte@earthlink.net> wrote:
>I found the issue..
>If I use
>curl_setopt($ch, CURLOPT_POSTFIELDS,
>"operation=DIRECTORY&Submit=Submit");
>
>it works
>but with
>
>$formvars = array();
>$formvars["Submit"]="Submit";
>$formvars["operation"]="DIRECTORY";
>curl_setopt($ch, CURLOPT_POSTFIELDS, $formsvars);
>
>it does not..
>Any idea why?
Maybe:
http://cvs.php.net/php-src/ext/curl/interface.c
Particularly look at revisions 1.30 and 1.46 and the bug it references?
It's not exactly well documented when you're supposed to pass as the parameter
when using CURLOPT_POSTFIELDS.
' CURLOPT_POSTFIELDS The full data to post in a HTTP "POST" operation.'
This seems to mean the raw POST data as per your first bit of code, but some
versions of the PHP curl extension seem to accept arrays (which is useful).
Looking at the code it appears to accept objects too.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|