I have a gallery where users can upload their images, and update or delete them.
All users images are then displayed in a main gallery page.
The way i did it was: create a condition that checks if a folder with the user name exists inside the gallery folder.
If it doesn't it creates a new folder with the user name, and then moves the image being uploaded to the user folder.
Now, each user has his own page named "my-images.php" where they can manage only their images. The source folder points only to his folder, so only their images are displayed.
Everything works fine here. The problem is in the main gallery, because i have to source the image from all
subdirectories inside the gallery directory.
the original image output
<a href="images/gallery/<?php echo($value['image']);?>" target="_blank">
<img alt="" border="2px" width ="150px" height="113px" src="images/gallery/<?php echo($value['image']);?>">
I tried changing to
I read something online about the glob() function.
But I'm not really sure how am I about to implement it in this particular case.
Any help is welcome,