Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 225
0 Users 3 Guests Online

Best PHP nav ever

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.");
     }
}
?>
ray230
Author:
Views:
2388
Rating:
Posted on Wednesday 3rd October 2007 at 03:21 PM
darklight19
darklight19
Lol, I was doing this before I seen this xD