<div class="cleared text-center">
<?php
$reload = $pagename."?catid=".$_REQUEST['catid']."&amp;secid=".$_REQUEST['secid'];
echo '<div class="pagination"><ul>';
if ($tpags > 1) {
echo paginate($reload, $pag, $tpags);
 }
echo "</ul></div>";
for ($i = $start; $i < $end; $i++) {
// make sure that PHP doesn't try to show results that don't exist
if ($i == $rows) {
break;
}
}?>
</div>