hello i think i have to many IFs in the page is there a better/faster way to write this page??
Thanks
<?
$id = $_REQUEST['id'];
if ($id == NULL || $id == home)
{
$page = "pages/body.php";
}
else
{
if (is_numeric($id))
{
echo "//TODO: this needs to have the code for code displaying using the \$ID";
}
elseif (file_exists("pages/".$id . ".php"))
{
if (eregi("C:[\]http[\]dlgnetworks_com", realpath("pages/".$id . ".php")))
{
$page = "pages/$id.php";
}
else
{
echo "<center><div id=\"error\">You are in violation<br /><br />";
echo "Your IP Address (".$_SERVER['REMOTE_ADDR'].") has been added to our ban list</div></center>";
$file = fopen('cant/show/file.ext','a+');
fputs($file,$_SERVER['REMOTE_ADDR']." - ".realpath($id . ".php")."\n");
fclose($file);
exit();
}
}
else
{
$page = "pages/404.php";
}
}
if ($page != NULL)
{
include ($page);
}
?>
also i was reading up on is_numeric() messing up on sertan things is that the best way to go for me the code IDs will be PONLY numbers but pages might hve tike "tut1"??.