Forum Moderators: coopster
I am assuming they are all real files. Just drop the is_file test in before you require it, if it's false drop to an else that shows an error page/message. Be sure to send proper 404 headers for files that don't exist.
<?
if (isset($_GET['xhtml']))
{
if (is_file($_GET['xhtml'].".xhtml"))
{
require($_GET['xhtml'].".xhtml");
}
else
{
require('404.php');
}
}
else
{
if (isset($_COOKIE['xhtml1']))
{
require('xhtml1.xhtml');
}
else
{
require('xhtml0.xhtml');
}
}
?>
if (isset($_COOKIE['xhtml1']))
{
echo "Cookie exists";
require('xhtml1.xhtml');
}
Just to make sure the cookie is actually set and that its not a problem somewhere else.
eelix
eelix