Buy Now
Sign in

PHP code help: switch based on two variables

damconsulting , April 18 at 21:40
d
damconsulting

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’:
default:
return ‘option_01_ita’;
break;
case ‘eng’ && ‘option_01’:
return ‘option_01_eng’;
break;
......
}
?>


Any help will be appreciated and I can pay for it.
Thank you.

admin

Hi DAM,

I have posted a reply here:
http://www.chronoengine.com/forums/posts/t103348.html#367113

Best regards,
Max

Max
If your main question got answered then please mark the answer using the button!