Jump to content

$_GET Menu with Second Variable ?


emcgfx

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.