Sorry I thought I copied the whole thing
<? // calculate number of pages needing links
$pages=intval($numrows/$limit);
// next we need to do the links to other results
if (($pages!=0 and $pages!=1) or ($pages==1 and ($numrows%$limit)))
// If data <= 1 page skip all
{
if ($offset!=0) // bypass PREV link if offset is 0 {
$prevoffset=$offset-$limit;
?>
<?
print "<a href=\"$PHP_SELF?offset=$prevoffset&category=$category\"><FONTSIZE=1 COLOR=\"#000000\" FACE=\"Arial\"><< PREV</FONT></a> \n";
}
?>
<?
// $pages now contains int of pages needed unless there is a remainder from division
if ($numrows%$limit)// has remainder so add one page
{
$pages++;
}
for ($i=1;$i<=$pages;$i++) // loop thru and make links
{
$newoffset=$limit*($i-1);
If ($offset!=$newoffset) //Make a link only for other pages
{
print "<a href=\"$PHP_SELF?offset=$newoffset&category=$category\"><FONT SIZE=1 COLOR=\"#000000\" FACE=\"Arial\">$i</FONT></a> \n";
} else {
print "<FONT SIZE=1 COLOR=\"#CCC000\" FACE=\"Arial\">$i</FONT> \n";
}
}
?>
<?
// check to see if NEXT link is needed
if ($pages!=1 or (($pages==1 and ($numrows%$limit))))
{
if (($offset+$limit)<$numrows) // if last page skip NEXT link
{$newoffset=$offset+$limit;
?>
<?
print "<a href=\"$PHP_SELF?offset=$newoffset&category=$category\"><FONT SIZE=1 COLOR=\"#000000\" FACE=\"Arial\">NEXT >></FONT></a>\n";
}
}
}
?>
TIA Richie TM