If you mean you want it to redirect to page=error if it doesn't exist, try this:
Code:
<?php
$page = $_GET['page'];
if (empty($page)) {
$page = "home";
}
if(!strripos($page,".php"))
include "$svr_rootself/$page.php";
else
header("Location: ./index.php?page=error&ref=$svr_rootself/$page");
?>
Then put this into your error.php file wherever you want it to show what page caused the error:
Optionally just use this to only redirect to an error page without telling the page that caused it:
Code:
<?php
$page = $_GET['page'];
if (empty($page)) {
$page = "home";
}
if(!strripos($page,".php"))
include "$svr_rootself/$page.php";
else
header("Location: ./index.php?page=error");
?>
Bookmarks