I am building a simple admin area for my site and I want the URLs to look somewhat like this:
http://mysite.com/admin/?home
http://mysite.com/admin/?settings
http://mysite.com/admin/?users
But I am not sure how I would retrieve what page is being requested and then show the required page. I tried this in my switch:
switch($_GET[])
{
case 'home':
echo 'admin home';
break;
}
But I get this error:
Fatal error: Cannot use [] for reading in C:\path\to\web\directory\admin\index.php on line 40
Is there any way around this? I want to avoid setting a value to the GET request, like:
http://mysite.com/admin/?action=home
If you know what I mean. Thanks. :)