Click to See Complete Forum and Search --> : Guest overflow ?


Asch
02-08-2003, 11:16 AM
Hi, i v made a guestbook...now the probleme is that to many people are leaving there message (is actually not a probleme lol :o)...I d like that only 10 messages per page a appearing and the old messages goes automaticly to another page !!(with always maximum 10 messages per page)!!

I've tried, some things but no succes...how do I have to do that.. : programming a counter??no idea how...or how can the "cgi", reconise how many posts ther are on each page and create a new one if all are full...??

thanks for your help !!

asch

jeffmott
02-08-2003, 01:13 PM
It depends on how you write to your guestbook. If you print each post to a static HTML page, you'll probably need some complex pattern matching. And the result will probably still be prone to error. If you have each post stored in a database and generate the pages dynamically you could use the following to loop through a specific range of index numbers and retrieve only those posts instead of every post.

$page = int(abs $page || 1) - 1;
for ($page * $msgs_per_pg .. ($page + 1) * $msgs_per_pg - 1)

Asch
02-08-2003, 03:24 PM
Ya, exactly for the moment i'm printing each post to a static Html page !!That's what I thought it's ****ty like that ;)...

Si if i have understood (my english isnt so good :) )...

I l create an other page a ".txt" for example, where every posts are ritten in it...this loop counts the messages in it...after that the new post is send to the correct page!!!
Do you mean something like that ??

what do you mean with generting this page dynamically??