Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Pagination for HTML articles (not items)
Old 08-11-2004, 11:32 AM Pagination for HTML articles (not items)
Junior Talker

Posts: 4
Trades: 0
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?
josh4 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-11-2004, 11:54 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
josh,

That's a tough situation and frankly when most people perform pagination, it is usually data coming out of a database, which is why you found so much information on LIMIT.

That said, I'm thinking about how you could take an HTML file and page it. If you read it in as a string (not War & Peace, granted), you may be able to explode() it according to <p> tag and then only print so many paragraphs on a page.

A less refined way would be to decide about how many characters to put on a page and do it that way, but you would have to write some "clean-up" code to make sure you performed the page break on a paragraph break or at least a sentence or word break.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Reply     « Reply to Pagination for HTML articles (not items)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10110 seconds with 12 queries