I hope someone can help me...
I spent last 3 days trying to figure out this thing. This is scenario:
Lets say I'll set directory to : "albums".
In albums directory are some folders and in each of those some subfolders.
I need to fetch all folders and subfolders of predefined directory and create list which will look like this:
albums/
albums/folder1/
albums/folder2/
albums/folder3/
albums/folder4/
albums/folder1/folder1/
albums/folder1/folder2/
...etc...
Please help me with this one 'cause I am dying for an answer and tried all possible.
This is the code I am using right now.
But that will find only first directories and not their subfolders. I am saving results to mysql.
// Find all folders in "albums" directory
$d = dir("albums/");
while($entry=$d->read()) {
$lowletname = strtolower(substr($entry,-4,1));
$lowletnameb = strtolower(substr($entry,-3,1));
if (($lowletname <> ".") & ($lowletnameb <> "."))
{
echo "<br>$entry";
$sql7 = "INSERT INTO jj_folders (jj_foldpath) VALUES ('$entry')";
if(!$result7 = mysql_query($sql7, $db))
{
error_die("Could not enter post text!<br>Reason:".mysql_error());
}
}
}
$d->close();
?>
Plese help !!!
Thanx a lot...
Jozef Jarosciak, Canada