I use to have something similar to the if/else..
code:
//Page system
if(!isset($_GET['page']))
{include('index.htm');}
elseif($_GET['page'] == "home"){include('index.htm');}
elseif($_GET['page'] == "news"){include('news.htm');}
//msn pages
elseif($_GET['page'] == "msn"){
if(!isset($_GET['ver']))
{include('msn.htm');}
elseif($_GET['ver'] == "8")
{include('msn/wlm.htm'); }
elseif($_GET['ver'] == "7.5")
{include('msn/7.5.htm'); }
else{include "error.php";}
}
elseif($_GET['page'] == "desktop"){include('desktop.htm');}
elseif($_GET['page'] == "downloads"){include('downloads.htm');}
elseif($_GET['page'] == "info"){include('info.php');}
elseif($_GET['page'] == "contact"){include('contact.htm');}
elseif($_GET['page'] == "contacted"){include('contact.php');}
elseif($_GET['page'] == "projects"){include('projects.htm');}
//w2m sec
elseif($_GET['page'] == "w2m"){
if(!isset($_GET['sec']))
{include('w2m/index.php');}
elseif($_GET['sec'] == "start")
{include('w2m/start.php'); }
elseif($_GET['sec'] == "tut")
{include('w2m/tut.php');}
else{include "error.php";}
}
//wdp sec
elseif($_GET['page'] == "wdp"){
if(!isset($_GET['sec']))
{include('wdp/dynamic.php');}
elseif($_GET['sec'] == "dynamic")
else{include "error.php";}
}
else{include "error.php";}
But then I got too many pages so i changed it to switch/case:
code:
if(!isset($_GET['page'])) {include "index.htm";}
elseif($_GET['page'] == "msn" && !isset($_GET['ver'])) {include "msn.htm";}
elseif($_GET['page'] == "w2m" && !isset($_GET['sec'])) {include "w2m/index.php";}
elseif($_GET['page'] == "wdp" && !isset($_GET['sec'])) {include "wdp/dynamic.php";}
elseif($_GET['page'] == "projects" && !isset($_GET['id'])) {include "projects.htm";}
else {
switch ($_GET['page']) {
case "home":
include "index.htm"; break;
case "news":
include "news.htm"; break;
case "desktop":
include "desktop.htm"; break;
case "comics":
include "comics.htm"; break;
case "downloads":
include "downloads.htm"; break;
case "contact":
include "contact.htm"; break;
case "info":
include "info.php"; break;
case "wdp":
switch($_GET['page'] == "wdp" && @$_GET['sec']) {
case "dyimg":
include "wdp/dyimg.php"; break;
case "dynamic":
include "wdp/dynamic.php"; break; }
}
}
These are not all the pages, itll take too much space