I have an Elseif statement, which gets a template name and includes the template PHP file which contains a large array, it outputs the result on the page.
$template = str_replace("-","_","{$_GET['select']}"); if ($template == "cuatro"){ include("templates/cuatro.php"); echo $page_output; } elseif ($template == "ohlittl"){ include("templates/ohlittl.php"); echo $page_output; } else { echo "Sorry, template not found."; } $page_output = "You've chosen $template_select[0].";
From there, I get a notice saying it couldn't find the $page_output variable.
Notice: Undefined variable: page_output in C:\ ... \template.php on line 10
It can find it if I put the variable in the included file though. But I'm trying to get this variable to remain on this page. How do I complete this?