Paging with php...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BETA
Forum Commoner
Posts: 47
Joined: Fri Jul 25, 2008 3:21 am

Paging with php...

Post by BETA »

Hello guys!
I have a news system and i have the pagination code right?
so it works perfect but...
my pagination code shows all the pages that there are, i mean starting at 1 and ending in last page but in order...
so it would print something like:
1 2 3 4 5 6 7 8 9 10 11 and so on...
and so on if there are more pages...
i want to only show like 3( or whatever) above the page you are in and 3 (or whatever) below... and i can't figure out how to do it... :(
so i would like it to show something like:
3 4 5 6 7 8 9
and there's a problem too cause when you are in 1 page per example u can't show pages below so you would have to show 5 (or whatever) above...
Can you guide me through it?
Or give me ideas of how to do it?
Thx in advance!
BB!
Post Reply