Skip to main content


Showing posts from August, 2005

Image gallery in 5 minutes using ColdFusion and PHP

Ok, here's the scoop:  I needed a way to show thumbnails for some photos and I didn't want to spend any more than 15 minutes to do it.  Talk about deadline, huh?  Anyway, here is what I came up with, and yep, I managed to throw it together in [about] 15 minutes.  You get to copy my code and implement it in 5 minutes, hence the subject.Overview:  This is running on a LINUX server running apache, with a modern PHP and ColdFusion 6.1.  Your server may not have the same specs, so this code won't work.  If so, sorry it didn't work out.This solution is to create a directory with images in it (jpegs for example).  To make it a gallery, we throw in an index.cfm page that uses <cfdirectory> to get a list of images to display.  We then loop through the listing, and for each image, generate a link and thumbnail using a nifty php script.  The php script creates a thumbnail on the fly and stores it in a subdir, and then displays it.  Cool, huh?  WARNING: This solution is not …