Pagination without using a database or cms?
I'm having a hard time trying to get my head around the best way to have pagination on a static html website (with php includes). Unfortunately I don't have enough time to learn how to use a database or cms for this website - it needs to finished soon for school. :(
- There are 80 student profiles.
- I am using the <?php include 'example.php'?> command to load the header and footer in each student page.
- Each student page has it's own jquery slideshow, along with some written content.
On each student page, I would like to have pagination. Similar to this approach would be really awesome:
But really, I'm not fussed, just as long as I can have some numbers which link to each page through a script or something.
Basically, I want an easier approach than having to manually link every button on each student profile page to go to the next/previous student pages.
Does anyone have any ideas/suggestions how I could go about doing this?
I would be so very very grateful for any help! :D
any pagination will need to be aware of a start and end number to render itself - if you knew that or could render that in a separate page, you could do an iframe (not so glamorous) or a php include in the specific pages that shows the page controls and numbers....
hard to give a more detailed suggestion w/o knowing more about your project...
you can see a real simple working example here
the main html page just has 5 divs:
a header and footer div which load in content via php includes
there is a div to contain the 'page number'/pagination information
a div for the actual page content to load into via php includes,
and a div for the buttons
there are other ways, but i just made an array to hold all the page content incudes ( this would be your student page information)
and just as Curtis suggests, there is a variable there which is used to keep track of/be aware of what page is laoding in/ what page number it is. then going to a next or previous student page would be easy.
anyway, i hope this helps or gives you ideas opn how you can make it work for you. if you need anything exaplained, just ask.