Re: help with php5 and cURL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: help with php5 and cURL

From: Andy Jeffries <news@andyjeffries.co.uk>
Date: Thu Apr 13 2006 - 18:06:17 CEST

Hi Mickey,

Two things:

1) Check that you've got the syntax of this right:

> curl_setopt( $session, CURLOPT_POSTFIELDS, $_POST['fields'] );

If $_POST['fields'] currently contains an array, you probably want to do
something like this:

curl_setopt( $session, CURLOPT_POSTFIELDS,
array("fields"=>$_POST['fields']));

Otherwise you aren't passing through a name the array can be referred to
using on the other side.

2) I don't know how PHP will handle you trying to pass an array (PHP
data structure) over HTTP. You may need to use the serialize/unserialize
functions on the data on the way in/out (respectively).

Cheers,

Andy

-- 
Andy Jeffries MBCS CITP ZCE   | gPHPEdit Lead Developer
http://www.gphpedit.org       | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Received on Mon May 1 02:55:25 2006