looking at making a basic image gallery, getting the images from a directory and storing them for use is simple enough. though i want to have 4 actions "first", "next", "prev" "last" that the user can click and a new image is displayed. again the code for these actions are simple enough; but how do you actually call these functions from say a <a href="">Next</a>
i thought you might be able to direct to user to image_gallery.php?action=next and catch that and perform the correct action before displaying the correct image.
am i along the right lines?
image gallery
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
pagination wouldnt quite suit what im after imo. i literally would like to display 1 image (first image in directory) with navigation options to allow the user to go to the first image, the previous image, the next image, the last image (in the directory). none of this information will involve a database it will take the directory and put it into an array and these functions will manipulate the pointer within the array.
Pagination is simply the act of paging through a list of things. It doesn't matter if they're database records, an array, a glob of files... the code is the same. The only thing that's different is how you make the list in the first place.sh33p1985 wrote:ok ill agree with you there, but doesnt pagination primarily work for data stored in a database?
Hi! My missis wanted a gallery recently and I wrote her a super simple one which you can look at here. It is one self contained script and there is a second script to admin it. No database! No sessions! No cookies! No Javascript! The admin script makes a thumbnail and resizes the image to a reasonable size. It will even run through a directory on the server that contains multiple images and thumbnail and load them. If you would like the code I can post it.