'; $html_foot =''; collect_hidden_files_list($dir_path,$is_recursive); echo($html_head); echo('

Checking for hidden files within: '. $dir_path ."

\n\n"); echo('If you see any paths specified under [failed_to_open], then it means that permissions errors '. "
\n" .'(or some other problem) prevented the script from opening that directory. You should, therefore, check those manually.'."

\n\n"); echo('
');

reset($paths_of_interest_arr);
$num_elements = count($paths_of_interest_arr);

if ($num_elements > 0)
	{
	print_r($paths_of_interest_arr);
	}
else	{
	echo('Nothing of interest found');
	}

echo('
'); echo($html_foot); //I just exit here to stop any appended scripts that may try to run exit; function is_hidden($directory_item) { //check if there is an empty string begfore the first dot $filename_arr = explode('.',$directory_item); if (strlen($filename_arr[0]) < 1) { //looks like we found a hidden file return 1; } //else return 0; } function collect_hidden_files_list($dir_path,$is_recursive,$recursed_path = '') { global $paths_of_interest_arr; $dir = @dir($dir_path); if ($dir == FALSE) { $paths_of_interest_arr['failed_to_open'][]=$dir_path; } else { while(false !== ($directory_item = $dir->read())) { if ($directory_item == '.' || $directory_item == '..') { continue; } if (is_dir($dir_path.'/'.$directory_item)) { if ($is_recursive) { collect_hidden_files_list($dir_path.'/'.$directory_item,$is_recursive, $recursed_path.basename($directory_item).'/' ); } } elseif (is_hidden($directory_item)) { $paths_of_interest_arr['opened'][]=$recursed_path.$directory_item; } } } } ?>