- Code: Select all
<?
ob_start();
$menu = array ("home" => "includes/home.php", "coding" => "includes/coding.php");
if (isset($_GET["view"])) {
if (in_array($_GET["view"], array_keys($menu))) {
require $menu[$_GET["view"]];
} else {
print "Error 404.";
}
} else {
if (basename($_SERVER["PHP_SELF"]) != "index.php") {
header ("location: index.php?view=" . array_search(basename($_SERVER["PHP_SELF"]), $menu));
} else {
require array_shift($menu);
}
}
$cnt = ob_get_contents();
ob_end_clean();
print $cnt;
?>
Now my links are index.php?view=page
And i want dynamic links like /index/page/ instead of the other link above. Whats the remodwrite for it? I have tried everything, but it simply wont work!
Petter