OK let me explain how this works
The switch works in the same was as the previous poster mentioned
Now depending on what the var section is depends on what is included.
So if you have page=contact&section=email it will do the following
1) Find out if there is a page called email.php, if there is
2) Include that page
Now if the section var is something that you don't have then it'll display the 404.php
The whole point is that you can use this type of coding to automatically work out what you want to include (OK so we've got an check to ensure that the file actually exists - but thats just good practice). This approach reduces the requirements to hard code things.
So to answer your question: You don't need to put anything else if you use the code that i posted - it works out what to include automaticall (in this case "email.php")
Any other questions just ask away
Originally posted by trooper
try this too 😃
switch($section)
{
if(file_exists("${section}.php"))
{
include "${section}.php";
}else{
include "cgi-bin/404.php";
}
}
Nice and neat
HTH
GM [/B]