Donloadscript > Do not display files with a specific extension.
I have a script for downloads in which the following instruction does not show certain files. This also works very well.
while ($file_name = readdir($dir_handle)) {
// Hide files so only visible files can be downloaded
if ($file_name != '.access' and $file_name != '.' and $file_name != '.htaccess' and $file_name != 'index.php' and $file_name != '001.php' and $file_name != '002.php' and $file_name != '003.php' and $file_name != '005.php' and $file_name != '007.php' and $file_name != '009.php' and $file_name != '010.php') {
$show_files
}
Question:
How to define all PHP files globally instead of having to explicitly define each PHP file like in the posted code? It doesn't work with $file_name != '*.php
Many thanks in advance for tips and hints