我的分页有问题。分页查询的php代码为:
$ <? if (isset($_GET["page"])) {
$Page = preg_replace("/[^0-9]/","", $_GET["page"]);
} else {
$Page = 0;
}
$limit = 10;
$StartFrom = $limit * $Page;
$TotalFiles = mysql_num_rows(mysql_query("SELECT * FROM linkuri WHERE `categorie` = 'Afaceri' AND status = 1"));
$TotalPages = floor($TotalFiles / $limit); ?>
以及显示它的代码:
$i = 0; while ($TotalPages >= $i) { echo '<a class="active imgf" style="opacity: 1;margin-bottom:3px; margin-top:3px;" href="afaceri.php?page='.$i.'">'.($i+1).'</a>';$i++;}
问题是我试图使显示为:PAGES: "BACK" 1 2 3 4 5 "NEXT"