I am trying to post an array using cURL from one PHP page to another. I
can't figure out how to correctly post and read the array on the page
that actually receives it. Here is what I have...
$session = curl_init();
curl_setopt( $session, CURLOPT_URL,
"https://www.myswebsite. com/receiving.php" );
curl_setopt( $session, CURLOPT_HEADER, false );
curl_setopt( $session, CURLOPT_POST, true );
curl_setopt( $session, CURLOPT_POSTFIE LDS, $_POST['fields'] );
curl_setopt( $session, CURLOPT_RETURNT RANSFER, true );
curl_setopt( $session, CURLOPT_SSL_VER IFYPEER, false );
curl_setopt( $session, CURLOPT_USERPWD , $sslpassword );
curl_setopt( $session, CURLOPT_HTTPAUT H, CURLAUTH_BASIC );
$returned = curl_exec( $session );
curl_close( $session );
echo $returned;
On the receiving page this echos zero ...
$numFormFields = count( $_POST['fields'] );
Comment