 |
 |
 |
|
 |
|
|
|
if(eregi("^[a-z0-9\-_\.]+$", $p, $regs)) //make sure $page is alphanumeric
{
$dir = ""; //not strictly necessary, can be blank.
$ext = ".php"; //.php, .html, .txt, whatever
if(file_exists($dir . $p . $ext))
{
include($dir . $p . $ext); //or readfile if not expecting php code
}
else
echo '404 - Not Found'; //or something similar
}
else
echo 'Looking for something?';
?> |
|
|