Jump to content


Photo

Multiple pages created from textfile


  • Please log in to reply
3 replies to this topic

#1 XeroXer

XeroXer
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts
  • LocationSweden

Posted 15 August 2006 - 09:16 AM

Hi there!
In my guestbook it reads all entrys from a plain textfile.
Now I was wondering if theres any way to make it pages instead of them all in one page.
Like if entrys get over 25 it creates a new page with the other ones.
And if it then get over a total of 50 it ones again creates a new page.
The hard thing is for me to make it not print out the same entrys on every page.
PLease help...
// XeroXer

#2 chriscloyd

chriscloyd
  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 15 August 2006 - 09:17 AM

use mysql
44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 15 August 2006 - 10:03 AM

read all the entries from the file into an array.

Then traverse the array in a loop with limits on(start at and stop at) you will then limit the number of entries displayed. Send these limits via the url (page.php?start=75&stop=100) and you should be fine.

Remember to initialize start and stop incase they are not set!!!!
follow me on twitter @PHPsycho

#4 XeroXer

XeroXer
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts
  • LocationSweden

Posted 16 August 2006 - 10:26 AM

ToonMariner:
That sounded like a good idea.
All my entrys start with "<table" and end with "</table>".
Can you help me how to do it more step by step?  ???

chriscloyd:
My guestbook is done so that it uses a textfile and not mysql.
Just because all people do not have acces to a mysql database.
So that solution is out of the question...
// XeroXer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users