I have made a PHP page which shows a list of files in one folder. Now that I don't want some one to access this folder directly, I plan to add a PHP script which redirects to index.php. Simply I don't want this file to appear in the list
Can I add exception to this extension only? or any better idea for that?
if ($handle = opendir('manual')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "<a href='manual/$entry' target='_blank'>$entry</><br>";
}
}
closedir($handle);
}