I've got a script that dynamically calls and displays images from a directory, what would be the best way to paginate this? I'd like to be able to control the number of images that are displayed per page through a variable within the script. I'm thinking of using URL varriables (ie - http://domain.com/page.php?page=1) but am unsure how to go about this.
Thanks for the help.
If you name your images 01.jpg, 02.jpg it makes it easier to paginate. Then use glob to get all the images into an array and sort it.
When in doubt use javascript! This might help too: http://www.webplicity.net/flexigrid/
Might be good for galery-like apps, though I've never tried it :)
pagination is the same concept with or without sql. you just need your basic variables, then you can create the content you want. here's some quasi-code:
hope that helps you get started!
This is a function I often use to do pagination. Hope it helps.
This will return:
With all that data you are then pretty well armed to make the pagination links.