cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-and-php mailing list Archives

CURLOPT_POSTFIELDS and associative arrays

From: <timhewitt_at_myostrich.net>
Date: Thu, 09 May 2002 16:20:20 -0400

I'm new to curl, and have been trying to use an associative array as the
argument to CURLOPT_POSTFIELDS. According to the upgrade notes for PHP
v4.0.3, this is now possible, but I can't for the life of me make it
work.

I can easily send a POST with the values in a string as in

  $postvalue = "a=1&b=2"
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postvalue);

however I'd really like to use something like

  $postvalue['a'] = 1;
  $postvalue['b'] = 2;

Can anyone help me out here?

Thanks,

-Tim

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth_at_sourceforge.net
Received on 2002-05-09

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET