Yes,
just provide a link like this:
Code:
<a href="search.php?filename=afile.html">Go to afile.html</a> (If it exists)
and a php file like this:
Code:
<?
$filename = $_GET['filename'];
if(!file_exists("../dogs/$filename"))
{
header("location: errorpage.htm");
}
else
{
header("location: ../dogs/$filename");
}
?>
-----------------------------------------------------
And if you want a personal error page on search.php:
Code:
<?
$filename = $_GET['filename'];
if(!file_exists("../dogs/" . $filename))
{
echo "Sorry! The file \"<i>$filename</i>\" does not exist.";
// use the echo command to output more html.
}
else
{
header("location: ../dogs/$filename");
}
?>
--------------------------------------
or if you keep the first example... (in bold)
Code:
if(!file_exists("../dogs/" . $filename))
{
header("location: errorpage.php?filename=$filename");
}
errorpage.php?filename=afile.html
Code:
<?php
$filename = $_GET['filename'];
?>
<html>
<!-- your custom html page here-->
Sorry! The file "<i><?php echo $filename; ?></i>" does not exist.
<!-- your custom html page here-->
</html>
untested.
May sound a little confusing, but any more questions, please post
Bookmarks