emcgfx Posted July 17, 2010 Share Posted July 17, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/208063-_get-menu-with-second-variable/ Share on other sites More sharing options...
joel24 Posted July 17, 2010 Share Posted July 17, 2010 editing your .htaccess will accomplish this... tutorial: http://www.freewebmasterhelp.com/tutorials/htaccess/ .htaccess generator http://www.webconfs.com/url-rewriting-tool.php Quote Link to comment https://forums.phpfreaks.com/topic/208063-_get-menu-with-second-variable/#findComment-1087619 Share on other sites More sharing options...
Zane Posted July 17, 2010 Share Posted July 17, 2010 I was wondering if there is better way to do this, any help would be awesome. Thank you guys. It's called Mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/208063-_get-menu-with-second-variable/#findComment-1087620 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.