I'm adding the PHP nav to my site, so the links would be appearing as http://www.cdesigns.....php?id=contact and so on...
First of all, am I right to just include it where I want it?
And here's the code I'm using... Should this work?
<?
$val = $_GET['id'];
$val .= ".php";
$dirty = array("..");
$clean = array("");
$val = str_replace($dirty, $clean, $val);
if (isset($_GET['id'])) {
if (file_exists($val)) {
include "$val";
}
else {
include "404.shtml";
}
}
else {
include "index.php";
}
?>
The reason I'm saying it doesn't work is because on the index page (and all the other pages it's screwed up. (Note- the only pages I have right now are index, portfolio, contact).
