Hey,
I am trying to run some custom code like this befor I redirect the form to another page:
I tried using a custom code block in "on submit". This code does not seem to be run or It is the wrong place to alter the $_POST Variables. Where would I have to do this?
Thanks
Martin
I am trying to run some custom code like this befor I redirect the form to another page:
<?php
$_POST['EMAIL'] = $_POST['emails'];
?>
I tried using a custom code block in "on submit". This code does not seem to be run or It is the wrong place to alter the $_POST Variables. Where would I have to do this?
Thanks
Martin
Hello SeniorDingDong,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
I need custom code for my form
What is the Custom Code action?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
I need custom code for my form
What is the Custom Code action?
P.S: I'm just an automated service😉
Hi Martin,
I would expect that to work OK. But what exactly are you trying to do here? The $_POST array isn't passed on anywhere by PHP.
Bob
I would expect that to work OK. But what exactly are you trying to do here? The $_POST array isn't passed on anywhere by PHP.
Bob
Hi Martin,
Thanks for the PM, I think that the problem probably is that, unlike CFv3, ChronoForms v5 only reads the $_POST array once when the form is first submitted.
In CFv5 if you want to pass data between actions you need to add it to the $form->data array e.g.
Bob
Thanks for the PM, I think that the problem probably is that, unlike CFv3, ChronoForms v5 only reads the $_POST array once when the form is first submitted.
In CFv5 if you want to pass data between actions you need to add it to the $form->data array e.g.
<?php
. . .
$form->data['SHASign'] = sha1($str);
?>
You can then pick it up later using either $form->data['SHASign'] in PHP or {SHASign} in HTML (not supported everywhere).
Bob
Hey, thanks for the quick reply.
I tried
and it results in the correct output:
a:
b: example@example.com
c: example@example.com
d: example@example.com
So your answer seems to be working. Great.
My next problem is that the array is not passed by the redirect plugin.
After redirect my POST Array still only contains:
emails example@example.com
EMAIL
Thanks.
Martin
I tried
echo "a: ".$form->data['EMAIL'];
echo "b: ".$form->data['emails'];
$form->data['EMAIL'] = $form->data['emails'];
echo "c: ".$form->data['EMAIL'];
echo "d: ".$form->data['emails'];
and it results in the correct output:
a:
b: example@example.com
c: example@example.com
d: example@example.com
So your answer seems to be working. Great.
My next problem is that the array is not passed by the redirect plugin.
After redirect my POST Array still only contains:
emails example@example.com
Thanks.
Martin
Hi Martin,
I still have no idea what you are actually trying to achieve here. Ther ReDirect action doesn't pass the $_POST array - nor does anything else.
If whatever you are redirecting to will accept GET then you can add the values to the ReDirect URL. Or if it's another ChronoForm you can use the Data to Session & Session to Data actions.
Bob
I still have no idea what you are actually trying to achieve here. Ther ReDirect action doesn't pass the $_POST array - nor does anything else.
If whatever you are redirecting to will accept GET then you can add the values to the ReDirect URL. Or if it's another ChronoForm you can use the Data to Session & Session to Data actions.
Bob
Hey, Thanks for your answer. I had to figure out how to add the values to the URL.
did the trick.
Now that its working its time to clean up and turn it into good code :-).
Thanks.
orderID=orderID
amount=amount
currency=currency
did the trick.
Now that its working its time to clean up and turn it into good code :-).
Thanks.
This topic is locked and no more replies can be posted.