View Single Post
Old 11-28-2012, 03:24 AM   PM User | #14
KULP
Regular Coder

 
Join Date: Mar 2012
Posts: 166
Thanks: 5
Thanked 11 Times in 11 Posts
KULP is an unknown quantity at this point
Didn't think you were just gonna copy paste, but I just revised it in an actual file (was just doing it off the fly but here you go)

PHP Code:
<?php
$cnt
100//Set to value in database
$currentpage 1// Whatever you wanna use. Use $_GET so it's dynamic.
$current 1;
$limit 20//Or set to other value, or user defined.

while($current <= $cnt)
{
    
$thislast $current $limit;
    if(
$thislast $cnt)
    {
          
$thislast $cnt;
    }
    if(
$current == ((($currentpage 1) * 20) + 1))
    {
          echo 
'<p class = "paginationBold">'.  $current ' - ' $thislast '</p>';
    }
    else
          echo 
'<a class = "paginationLink" href = "insert url">' .  $current ' - ' $thislast '</p>';

    
$current += $limit//Added this to update $current. Was missing.
}
?>

Last edited by KULP; 11-28-2012 at 05:32 AM..
KULP is offline   Reply With Quote
Users who have thanked KULP for this post:
mfoland (11-28-2012)