Hi everyone,
Sorry for posting so late, I was quite busy in the past few months and not very active in the forums
I 've got many request for sharing the solution so here is how it works.
First of all, forget about the "Send to arbitrary action" function since it doesn't seem to work.
After you created your form in formbuilder , make sure that that your fields have a unique alias.
So, let's say one of my text input field alias is "
myfield1" and the other one is "
myfield2"
After that we are going to create a UDT:
Since we have more than one field data to output, we need to create a new array call it
$temp_url.
Let's populate the array with our formbuilder field data. Were are going to use the
.urlencode PHP function to adapt the data for URL formatting.
Code: Select all
if(isset($params['myfield1'])){
$temp_url[] = 'myfield1=' . urlencode($params['myfield1']);
}
if(isset($params['myfield2'])){
$temp_url[] = 'myfield2=' . urlencode($params['myfield2']);
}
Finally we are going to incorporate our data array into our URL and redirect the page with an HTTP header. In this example I assume the page alias that receives your data is called "
form-results".
Code: Select all
$url = 'http://mysitename.com/form-results?' . implode($temp_url, '&');
header('Location: ' . $url);
exit();
So your UDT should look like this, I added an if statement for debugging in case something went wrong:
Code: Select all
$temp_url = array();
if(isset($params['myfield1'])){
$temp_url[] = 'myfield1=' . urlencode($params['myfield1']);
}
if(isset($params['myfield2'])){
$temp_url[] = 'myfield2=' . urlencode($params['myfield2']);
}
if(count($temp_url)){
$url = 'http://mysitename.com/form-results?'' . implode($temp_url, '&');
header('Location: ' . $url);
exit();
}else{
echo "Houston we've got a problem. Wrong params!";
var_dump($params);
}
Name this UDT "
form_redirect".
Go back to Formbuilder, add a
*Call A User Defined Tag With the Form Results, select "form_redirect".
Make sure to check this:
Export form reference to UDT as $params['FORM']? (do not do this if you are going to print_r($params) ):
Save the whole thing.
Try your form. After submit, it should redirect you to
http://mysitename.com/form-results/?field1=[field1 data]&field2=[field2 data]
Now, if you want to use your form data on your page, use the GET function.
Code: Select all
{$smarty.get.field1}
{$smarty.get.field2}
That's about it.
I hope this helps !