hi all - the following code seems good in terms of security (to the best of my knowledge) but it seems to think up to 3-4 seconds before it starts loading, can someone please help and take a look to see if there is another way but serve the same purpose? Your help is appreciated. Thanks.
PHP Code:
/*** the array of allowed pages ***/
$ok_p = array('pricing',
'about',
'plan',
'register',
'support',
'terms',
'privacy',
'sitemap');
/*** check if file name is in array ***/
if(!in_array($_GET['pages'], $ok_p)){
echo '<div class=warn><h2>Error!</h2><p>The page entered is unavailable.</p>';
}
else
{
/*** assign the file name ***/
$file = "./pages/".$_GET['p'].".php";
if(!file_exists($file))
{
echo '<div class=warn><h2>Error!</h2><p>The file requested is unavailable.</p>';
}
else
{
/*** include the file ***/
include $file;
}
}









Bookmarks