Need a little more info then the faq and guides provide

BritBlokeComputers 04 Dec, 2014
I have scoured the forums (search function appears broken partially, which makes it harder) the faq and guides do not seem to contain complete information, just talking about functionality without actually telling you how it works or how to do it.

I would like some info about a couple of things.

[list]How to pass info from the form to a php script using curl, what code in the php script am I using to get the values of the form data being submitted, I tried using standard $_post[''] variables with the names of the form fields but that didn't work, so what is the variable I need to read from in my php file to access the form data being sent to it when using the curl action.[/list]
[list]How do I create a second hidden form and pass the info from the first form to it (all into one hidden field of the second form) along with some other info in hidden fields and then have this form submit to an external site using post method.[/list]

Thanks
GreyHead 04 Dec, 2014
Hi BritBlokeComputers,

I find that Google search is usually better than the forum search. Either add 'ChronoForms' to the search or I have a custom search here (Max seems to have removed the menu link here in the last upgrade).

The form data is saved by ChronoForms into the $form->data array though $_POST is also still available as are the Joomla! Jinput methods.

ChronoForms has a built-in cURL action which works for many applications - though you can't change the cURLOpts if you need to customise them :-(

I'm not clear what you need to do with a hidden form that cURL won't do?

Bob
BritBlokeComputers 04 Dec, 2014
Well for the hidden form I need to firstly collect a bunch of information on form one which gets passed to form 2 after being validated and then form 2 would take all the various answers and inputs and lump them together into one long string of text separated by some kind of unique identifier that can be later used to separate the string into its individual parts.

This second form would contain that string in one hidden field, and several other hidden fields of info, plus a visible continue button perhaps also with auto submitting functionality too.

Upon submitting this second form it would pass the information via post method to an external site that the user sees and interacts with (hence why cURL wouldn't work for this bit), then once the external site has finished doing its bit, it would pass the long string of stored form data to a script to separate it and use it and redirect the user back to the thank you page of the form, or some custom thank you page I create in Joomla!.

So this could be a main form and a second form, or a multi page form as long as all the input from the first form fields can be lumped together into one big string and passed into the value of a hidden field on the second form/page.

This is how I can integrate the form successfully with the external website as they only have one field for passing this custom information which is why I have to join it all into one string of info.
BritBlokeComputers 04 Dec, 2014
FYI I figured out the first bit using cURL and got the values to pass successfully and all that works just fine. using $_POST variables in my php script to intercept the values from the form and use them.
GreyHead 05 Dec, 2014
Hi BritBlokeComputers,

I misunderstood the 'hidden form' bit - you still have an unhidden submit button.

I'd probably json-encode the data in a custom code action
<?php
$data = $form->data['data'];
// remove unneeded elements
unset($data['xxx']);
unset($data['yyy']);
$form->data['data'] = json_encode($data);
?>
modify that to exclude any data you don't need.

Then you can either hand-code the 'hidden' form in a Custom Code element, or treat it as the second page of a multi-page form and use the ChronoForms designer.

Bob
This topic is locked and no more replies can be posted.