You are here: help with php5 and cURL « PHP Programming Language « IT news, forums, messages
help with php5 and cURL

Posted by mickey on 04/12/06 17:32

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_POSTFIELDS, $_POST['fields'] );
curl_setopt( $session, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $session, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $session, CURLOPT_USERPWD, $sslpassword );
curl_setopt( $session, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );

$returned = curl_exec( $session );
curl_close( $session );
echo $returned;

On the receiving page this echos zero ...

$numFormFields = count( $_POST['fields'] );

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация