
<?php

 exit;
if(isset($_REQUEST['folder']) && trim($_REQUEST['folder'])!='')
{
    $current_folder=dirname(__FILE__).DIRECTORY_SEPARATOR.$_REQUEST['folder'].DIRECTORY_SEPARATOR;
    if(!is_dir($current_folder))  echo "INVALID DIRECTORY";
}else
{
   $current_folder=dirname(__FILE__); 
  
}
 echo '<h1>'.$current_folder.'</h1>';

$indir = array_filter(scandir($current_folder), function($item) {
        global  $current_folder;
		return !is_dir($current_folder.DIRECTORY_SEPARATOR.$item);
});
if(count($indir))
{
    echo "<h4>FILE COUNT : ".count($indir);'</h4>';
}else
{
    echo "<h4>FILE COUNT : 0</h4>";
}
exit;
 
?>