/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] php directory to thumbnail gallery

hi guys, i’m developing a property rental site, and i’d like to allow the owner to be able to click a link and bring up a photo gallery of thumbnails showing all uploaded images.

can you tell me or point me to a tutorial that will turn the whole image directory of only .jpg images into a thumbnail gallery.

i want php to auto-detect all the .jpg files in the ‘image’ directory and then create a thumbnail gallery of clickable/linked images with their short filename appended as pid=”filename.jpg” like this …

[CODE]
<div style=”width:700″>
<a href=”UpdatePhoto.php?pid=fireplace.jpg”>
<img src=”fireplace.jpg” height=”125″ width=”125″>
</a>
</div>
<a href=”UpdatePhoto.php?pid=bathroom.jpg”>
<img src=”bathroom.jpg” height=”125″ width=”125″>
</a>
[/CODE]

etc.

i can style and pad the images and all that, i just need
php to auto-detect the jpegs and link them with their
short filename as the $pid variable.

UpdatePhoto.php already knows what to do with $pid,
but i don’t want to hard code the list of files, i want php
to simpl detect the images and link them for me.

thanks for your assistance.

p.s. i found some ready made scripts that list the
contents but i find it difficult to modify plus they
list every type of file, i only need it to recognize images,
so i don’t need all that extra code that recognizes every
other file type.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bsmbahamasauthorOct 15.2009 — hey guys i already found a solution at....

>> http://www.tech-evangelist.com/2009/02/28/display-directory-contents-with-select

(not my site)


it creates a select box, but i modified it to display clickable thumbnails instead of populating the select box.

works like a charm
×

Success!

Help @bsmbahamas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...