Howdy,
I need to implement a selection menu within a php program for navigation to it's various functions. Currently, I'm hard-coding a single choice:
function1();
// function2();
// function3();
So, obviously, function1 executes in the case above. How can I present a menu so the user can choose a particular function? Or, can I call the program with a desired starting point?
i.e. program.php?function3();
Thanks!
Building a menu
Moderator: General Moderators
Easily done. In a link, set the variable 'view' (or whatever you like) to style1. IE: program.php?view=style1 or program.php?view=style2
Hope this is what you were looking for.
Code: Select all
<?php
if ($view == "style1")
{
// Include function 1
function1();
}
elseif ($view == "style2")
{
// Include function 2
function2();
}
else
{
function_default();
}
?>