Buy Now
Sign in

PHP code help: switch based on two variables

damconsulting , April 18 2017, 21:40
damconsulting 28
April 18 2017, 21:40 #367099
Hi, I'm using CF5 for a website where I have 2 dropdown: the first named 'language_switch' and the second named 'page_switch'.
I'd like to use it to select languages and products and then activate different redirect events on submit button.
I followed this tutorial and it works fine if i use only one variable.

But I'm in the need to use 2 variables and I'm not able to concatenate choices...
I try to use switch function but I don't know PHP...

switch ($form->data[‘language_switch’] && $form->data['page_switch']) {
case ‘ita’ && ‘option_01’:
return ‘option_01_ita’;
case ‘eng’ && ‘option_01’:
return ‘option_01_eng’;

Any help will be appreciated and I can pay for it.
Thank you.
admin 29
April 19 2017, 09:00 #367114

I have posted a reply here:

Best regards,
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!