ajax - Multiform data form with PHP CURL -


how serialize following code , make static variable above listen previous form input?

how post multi form data following, please help.

    <?php          $dest = 'phonenumber';          $user = 'username';          $pass = 'passowrd';              $ch = curl_init("http://hlr.routotelecom.com/");              curl_setopt($ch, curlopt_header, 0);              curl_setopt($ch, curlopt_post, 1);              curl_setopt($ch, curlopt_postfields, "number=$dest&user=$user&pass=$pass");              curl_setopt($ch, curlopt_postfields, array('field1=value&field2=value2'));             curl_setopt($ch, curlopt_returntransfer, 1);              $output = curl_exec($ch); curl_close($ch);             echo print_r(json_decode($output), 1);   ?> 

don't build own query string. curl happily accept array , you:

$data = array(     'number' => $dest,     'user' => $user,     'pass' => $pass );  curl_setopt($ch, curopt_postfields, $data); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -