Dec 27th, 2009, 6:39 AM
OK, excellent looks like I have found away around this using Curl.
Instead of going through the form tools API, im using the process.php method and automatically sending the form, after a success message from the SOAP webservice, via Curl.
Here is the Curl code:
All the fields are in the $data array and this is where you would also put the hidden formtools fields, such as the initiate form and the form ID field.
It would have been nice to use the formtools API, but I guess this works as all I needed was to get the data into formtools somehow.
Anyone have any opinions about this method, is it good or would you recommend another approach?
Happy new year!
Instead of going through the form tools API, im using the process.php method and automatically sending the form, after a success message from the SOAP webservice, via Curl.
Here is the Curl code:
Code:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/path/to/formtools/process.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
'foo' => 'foo foo foo',
'bar' => 'bar bar bar',
'baz' => 'baz baz baz'
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
?>
All the fields are in the $data array and this is where you would also put the hidden formtools fields, such as the initiate form and the form ID field.
It would have been nice to use the formtools API, but I guess this works as all I needed was to get the data into formtools somehow.
Anyone have any opinions about this method, is it good or would you recommend another approach?
Happy new year!