Jump to content

Listing directories and grabbing files


Mutley

Recommended Posts

If I have a folder structure like this:

 

> images

-> Folder A

--> image1.jpg

--> image2.jpg

-> Folder B

--> image1.jpg

--> image2.jpg

-> Folder C

--> image1.jpg

--> image2.jpg

 

 

I'd like to list each folder in the 'images' directory as text, so:

 

Folder A

Folder B

Folder C

 

I then, when you click on one of the links for say, Folder B, it displays the images inside, image1.jpg and image2.jpg

 

Can anyone provide some code snippets to get me going? I realize a DB would be better for this but I'd like to try this method for just a small site.

 

Thanks in advance.

 

All the best,

Nick.

Link to comment
https://forums.phpfreaks.com/topic/200727-listing-directories-and-grabbing-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.