Generating next and previous links for a gallery

Hello everyone. I hope this topic hasn’t been asked before - at least, I couldn’t find any mention of it after searching.

I’m wondering if there is any way to use PHP to flag when a certain image is being displayed in a gallery and dynamically generate a pair of “Next” and “Previous” links to the next and previous pictures in the gallery. So, for example, if Picture 3 is being displayed, the “Previous” link will point to Picture 2 and the “Next” link will point to Picture 4.

I hope I’ve explained that clearly!

Yep that can be done. Now to do it is going to depend on different things.

Is there database where the file names are stored or are you going to just read the directory of pictures?

Sponsor our Newsletter | Privacy Policy | Terms of Service