Hi everyone,
First I’ll try to explain as clear as possible to describe what I’m trying to achieve.
Well so I’m writing a CMS for a website, and a gallery is one of the things which should be implented. Ofcourse users should be able to upload images to the gallery. Now the gallery should have different albums and users would be able to either make a new album or upload the images to an already excisting album. (the different albums should be just directories in the main gallery directory) So in the tab for uploading new images there should be an option to select the excisting directories(albums).This list should be auto-updating ofcourse.
therefore I wrote this piece of code
[php]
$path = ‘…/foto/images/’;
$dirs = scandir($path);
foreach ($dirs as $dir) {
if (is_dir($dir) && $dir != ‘.’ && $dir != ‘…’)
{
$name = basename($dir);
echo ‘’.$name. PHP_EOL.’’;
}
}
[/php]
The current directory is something like this.
images/test
/test02
/test03
But somehow the outcome of this code outputs absolutly no entries in the list, and I have no clue why or how to solve this, I tried this
[php]
if (!is_file($dir) && $dir != ‘.’ && $dir != ‘…’)
[/php] but this however outputs everything, even the files.
I hope someone could help me out with this. It would be greatly appreciated!
Greetings
Yoram Vleugels