Page 1 of 1

Pagination for HTML articles (not items)

Posted: Wed Aug 11, 2004 9:39 am
by josh4
I'm having trouble trying to figure out how to use pagination in a certain way. I understand the method if you are running a query or listing specific items in a database. What I don't understand is how you generate pagination when all you have is a single HTML file that you want to split up into separate pages.

So far when I look for answers on pagination all I can find is stuff related to LIMIT statement and using offsets.

Say the book war and peace was typed out into a single HTML page. How would I use PHP and MySQL to separate that HTML file into multiple pages?

I've thought about including page tags, such as having
{PAGE 1}
blah blah blah blah blah
{PAGE 2}
blah blah blah blah blah

But this would require the tags to be manually entered and edited in the pages. It'd be much more helpful if I had a way for a single script to separate the pages entirely on its own. So warandpeace.html could just be uploaded onto the server and when it is accessed the pages are automatically generated.

help? please?

Posted: Wed Aug 11, 2004 10:05 am
by CoderGoblin
Not directly an answer but a question for you...

How would you determine what a page is ? Bear in mind that different monitors show different amounts of infomation. Any methodology would need some way of determining the "separator" be it x lines or whatever. Then what about trying to keep paragraphs on the same page (window/orphans in Desktop Publishing terminology). Is this a proportional or fixed width font?
There are a few of many questions to answer.

Rather than have a one page HTML file you could have a piece of code which scans through your book to split it into smaller HTML chunks. The algorithms used for when to split would need to be defined. Then each of these chunks would be linked to each other. This is prior to the user accessing your site as it is too time consuming to perform it each time.