Sesquipedalian wrote:Why does that matter?
Security Flaw/Vulnerability.
One suggested remedy is to put all the files you will allow users to view into an array.
Then, check to see if the request is valid, and that the requested value is in that array of allowed files.
IF so, include file...
ELSE, throw error OR include default file...
<?php
// psuedo code
$default = 'default.php';
$allowed = array('file1.php', 'file2.php', 'file3.php');
if(isset($_GET['page']))
{
if(in_array($_GET['page'], $allowed))
{
include $_GET['page'];
}
else include $default;
}
else include $default;
?>