Pagination

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
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Pagination

Post by quadoc »

Could someone show me some tips? I've the following code, what I want to do is to display a page of 20 rows and display the following at the bottom of the page. I'm not quite know how to do this. :?

1 2 3 4 5 6 7 8 9 10 next

when the user click on next, I would like to have it display

prev 2 3 4 5 6 7 8 9 10 11 next

Code: Select all

$i_limit_start = $next * $g_limit;
$i_no_of_pages = $no_of_pages;

		for($vloop = 0 ; $vloop < $no_of_pages ; $vloop++)
		{
		  if( ($vloop) != $next)
		    {	
		    	print("<a href = '".$HTTP_SERVER_VARS["PHP_SELF"]."?x=admin&a=show&dep=".$dep."&tixstatus=".$tixstatus."&next=".$vloop."&order=".$p_order."&col=".$i_col."' class = 'link'>&nbsp;".($vloop+1)."&nbsp;</a>");
			}
			else
			{
				print("<a href = '".$HTTP_SERVER_VARS["PHP_SELF"]."?x=admin&a=show&dep=".$dep."&tixstatus=".$tixstatus."&next=".$vloop."&order=".$p_order."&col=".$i_col."' class = 'link'><font color = 'red'><b>&nbsp;".($vloop+1)."</b></font>&nbsp;</a>");
			}
		}
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

There is a new thread where TimVW and I have posted code (I just added my latest just before you posted). It is here:

viewtopic.php?t=43777&start=45

There is also some pager code in Code Snippets here:

viewtopic.php?t=38830
(#10850)
Post Reply