Redirecting to an event in PHP

itpates 12 Sep, 2018
I have a drop-down, and am trying to set up a function to redirect to an event based on the input from the drop-down using a simple PHP switch in Custom Code. However, shortcode like
{redirect:event_name} 

is not working. I feel like this should be a trivial thing but have not found any solution in my search. Example code below;
<?php

$foo= $this->data['data1'];
switch ($foo) {
case 1: {redirect:event1};
break;
case 2: {redirect:event2};
break;
case 3: {redirect:event3};
break;
default: {redirect:index};
break;
}
?>
itpates 12 Sep, 2018
Made it work using the Switch function.
healyhatman 13 Sep, 2018
Shortcodes don't work in PHP, just for future reference.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger