Quote:
Originally Posted by KULP
I think everyone understands that style of pagination. The pagination would be simple.
Code:
$cnt= //set to value in database
$currentpage = $_GET['page']; // Whatever you wanna use.
$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>";
}
|
Tried that and I got a blank page.. hmm. I even did the page = and went from there.
EDIT-- The Echo was wrong there.. but After fixing that, it would repeat 1-19 a ton of times. $cnt should be getting the total from the database.