You can create cases for like
index.php?page=pagename
And the code below will say whatever page is, to look for the case, and require what case pagename has.
I'm not making any sense.
- Code: Select all
<?php
// Set page to any kind of variable you want to replace page in index.php?page=pagename
if(isset($HTTP_GET_VARS['page']))
// Be sure that if you change the page field in the first line to change it here in the $p area as well
{
$p = $HTTP_GET_VARS['page'];
}
// This says that if index.php has no value to get a home page included, but address bar still contains index.php
else
{
$p = 'index';
}
switch($p)
// Below is case index, where the $p='index'; looks for a home page. We can tell it for the homepage to look for home.php
{
case 'index':
require('home.php');
break;
// Here you can insert more and as many as you want require cases. Archives do not run here with &file=
case 'news':
require('news.php');
break;
// You can also make redirects manually instead of using an include redirect, see the code in my reply post for how to do so
case 'phpbbstyles':
require('phpbbstyles.php');
break;
// All require pages must end in .php
case 'anything you want':
require('mypage.php');
break;
// The error message if a required page will not come up or a bad variable is given see my 3rd reply for more info
default:
exit('Error 404');
}
?>

