- Joined
- May 12, 2005
- Messages
- 251
- Reaction score
- 9
Okay short and simple..
The page doesn't load "default" by default i need to call it by enter index.php?page=default
And my question is why doesn't god love me and make it work? ^^
The default page is both included in root and in a subfolder called "moduler" Have i done something wrong?
Please help!
EDIT:
By changing the code to
It gives me the error message when i try to enter a module that doesn't exist.. Wich is good and bad since i want it to load a separate module when another one isn't called and when another one that's called doesn't exist.
EDIT2:
By havning
instead it successfully load the default page WHEN i try to load a page that doesn't exist. So my final question is, how to configure the code so it loads default by default aswell when i visit my front page
PHP:
<?PHP
if(isset($_GET['page']))
{
switch($_GET['page'])
{
case 'test1':
include('moduler/test1.php');
break;
case 'test2':
include('moduler/test2.php');
break;
default:
include('default.php');
break;
}
}
?>
The page doesn't load "default" by default i need to call it by enter index.php?page=default
And my question is why doesn't god love me and make it work? ^^
The default page is both included in root and in a subfolder called "moduler" Have i done something wrong?
Please help!

EDIT:
By changing the code to
PHP:
<?PHP
if(isset($_GET['page']))
{
switch($_GET['page'])
{
case 'test1':
include('moduler/test1.php');
break;
case 'test2':
include('moduler/test2.php');
break;
default: echo "Error 404 this page doesn't exist on xxxxxxx.com" ;
}
}
?>
It gives me the error message when i try to enter a module that doesn't exist.. Wich is good and bad since i want it to load a separate module when another one isn't called and when another one that's called doesn't exist.
EDIT2:
By havning
PHP:
case 'test2':
include('moduler/test2.php');
break;
default: include('moduler/default.php');
}
}
?>