Need help! gathering iamges and displaying names

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
aLf
Forum Newbie
Posts: 4
Joined: Sun Nov 13, 2005 3:58 am

Need help! gathering iamges and displaying names

Post by aLf »

I need help!
I need to gather all images from directiory, and then display all pictures one under another
Only needs to show picture and name.jpg under it!


EXAMPLE:

Code: Select all

--------
- IMG1 -
--------
img1.jpg

--------
- IMG2 -
--------
img2.jpg
Hope you got the point!

Thank you in advance!


aLf
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

you need PHP, you have to use opendir, readdir and check for extensions...start from here
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

glob() might be easier

Code: Select all

<?
glob("/path/to/dir/*{.gif|.jpg|.png}",GLOB_BRACE);
?>
That line *should* get you all the GIF, JPG, and PNG files in that directory. From there it's easy.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply