Whether you're working with a site like this one or just want to have a simple way to browse through the information on a site, pagination of the information is the way to go. PHP makes it easy - especially with MySQL. But, for those out there that want a more database-independant way to do things, this new article from DevShed ("Previous or Next? Paginating Records with PHP, part 1") might just be the ticket.
Putting all of your content for a particular file on one page can be very user unfriendly to website visitors. Nobody likes to be confronted by a tiny vertical scroll bar! In this article, the first in a series, you will learn a simple way to paginate records from a text file using PHP.
We're going to present different approaches for implementing an efficient paginating mechanism using PHP, which hopefully will be useful to employ on any existing or future Web projects.
Their first example is a procedural way to paginate the data (pulled from a text file) with a single function - paginateRecords. It takes in the data, the current page number, and the number of records in a page. Unfortunately, it doesn't look like they give you the source (yet) - it might be coming in the later parts. Until then, there's always cut & paste...




