PHP parameter without value using for navigation
- by somewalri
Hello,
I am trying to set up a navigation system that uses GET parameters with no value, example:
http://foo.bar/?mainPage
takes the visitor to the main page.
So I am using if statements and I am wondering if there is a way I can do this without a bunch of if statements? I don't think switch statements would work for this. This is currently what I have:
$mainPage = $_GET['mainPage'];
$contact = $_GET['contact'];
if(isset($mainPage)) {
// go to main page
}
if(isset($contact)) {
// go to contact page
}
I don't want to have to end up writing a ton of if statements, though. Any ideas?
Thanks.