PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$id = $_GET['id']; //get the value of $id
if (empty($id)) //if no id was requested, then include our default page - like a welcome message for example. DON't make it index or it will loop for ever as it will include index, again and again and again.
{
include("news/display.php"); //include this page
}
else
{
if (file_exists($id.".php")) //else we check the requested page exists..if it does, include it
{
include($id.".php");
}
else //else the page doesn't exist, so show our error page or whatever.
{
echo("Page Not Found. Please Try Again.");
}
}
?>