The following code given to me in another forum, as a "simple photo gallery" code, but I'm still experiencing problems with it. I don't know how to make the two pages interact correctly. I am assuming the [REF] etc sections are causing the problems, but I don't know what they need to be replaced with to pull the relevant info from the database. Any thoughts?

Current page:

I am aiming for this sort of format:


gallery.php code:

gallery_template.htm code:


Where does the array $row come from on line 27 of the gallery script??

Also, the second PDF link you uploaded doesn't work.


Thanks for taking the time to respond. While my internet has been down, I've been back to basics - my level of basics, and am a step nearer to achieving the gallery I want:

I was trying to achieve a layout like this:

As you can see, I've not quite pulled it off. Seeing the botched attempt though has shown that the sample_gallery format would work nicely in a two columns as per:

How would I go about editing my code to achieve this style? Are there any other ways of improving the code below?


Thumbnail links don't yet work... not a bug, just not got around to that bit yet!

Hi again,
A thought regarding the layout of your gallery. You could have all the photos arranged in a grid manner, with a 10 or 20px margin between each. Then for displaying information, you could have a div tag display on hover with the dates and names or whatever, together with a message stating to click here to view a larger image. This could then be displayed in a lightbox window using JS and/or Ajax.

The code for the lightbox and ajax are free online. The styles for the gallery would also be relatively simple, and I've posted a solution yesterday stating how to have a div tag display on hover.

Just a thought.


Thank you, that could indeed be a possibility. I'd like to try out the structure I'm aiming for first, though, if anyone has thoughts on how to achieve it.

This question has already been answered. Start a new discussion instead.