a question about directory browsing via php
Posted: Thu Jun 03, 2004 3:11 pm
ok so heres the deal, ive grown to be a bit of a security freak.....
i like there to be a index file in every folder on my webserver, now it would not be a problem if i was the only person who has ftp access but im not, and many people create new dirs, so i want to write a cron that will, say once a week run through the entire directory structure checking for a index.php file in every folder, if there is one to pass on to the next folder, and if there is not one to create a blank index.php file
i have used this code to create an array of all the files and folders
could someone guide me in the correct direction, not sure really where to go from here, or if it is really even possiable
thanx
i like there to be a index file in every folder on my webserver, now it would not be a problem if i was the only person who has ftp access but im not, and many people create new dirs, so i want to write a cron that will, say once a week run through the entire directory structure checking for a index.php file in every folder, if there is one to pass on to the next folder, and if there is not one to create a blank index.php file
i have used this code to create an array of all the files and folders
Code: Select all
<?php
$folder = "/";
if($handle = opendir($folder))
{
for($i = 0; $files = readdir($handle); $i++)
{
if ($files != "." && $files != ".." && $files != "Thumbs.db")
{
$array[$i] = $files;
}
}
}
?>thanx