I'm using this menu now:
switch(safe($_GET['p'])) {
// Navigation Menu // English
case 'page1':
$get = 'page1'; break;
case 'admin':
$get = 'admin'; break;
default:
$get = 'page1'; break;
} //menu switch
Then get pages with:
if (file_exists("$get.php")) {
require_once(safe("$get.php"));
} else {
echo 'sorry, not done yet ;-)';
}
This works perfectly: index.php?p=page1
I use clean urls, so I do this actually: http://domain.com/page1
What I want to do is something like this for example;
http://domain.com/admin/add
Where "add" is the function of admin page.
I can add this kind of switch to admin.php file and call it something like this: http://domain.com/admin&a=add
But I was wondering if there is better way to do this, any help would be awesome. Thank you guys.