simple page not found 404 script - PHP
- From: dwayne@xxxxxxxxxxxxxxx ("Dwayne Heronimo")
- Date: Fri, 30 Mar 2007 14:45:33 +0200
Dear All,
I have made a simple php script that will show an 404.php error page when an
item is removed.
You can see the page here:
http://arubaguide.org/arubaguide/categories.php?catcode=art
But some how this is not working. It is displaying the 404 page and the
normal page.
<?php
/* function to get an external file into a vatiable */
function get_include_contents($filename) {
if (is_file($filename)) {
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
return false;
}
/* configuration file */
$errormsg = get_include_contents('404.php');
$pagename = $_GET['page'];
/* end configuration file */
if(file_exists("$pagename"))
{
include "$pagename";
}
else
{
echo "$errormsg";
}
?>
is the $pagename not enough for this script?
Let me know..
Dwayne
.
- Follow-Ups:
- Re: [PHP] simple page not found 404 script - PHP
- From: Zoltán Németh
- Re: [PHP] simple page not found 404 script - PHP
- Prev by Date: Re: [PHP] Link to download files on another part of system
- Next by Date: Re: [PHP] simple page not found 404 script - PHP
- Previous by thread: Calling SQL 2005 Soap Endpoint from PHP
- Next by thread: Re: [PHP] simple page not found 404 script - PHP
- Index(es):
Relevant Pages
|