if( isset($_GET['page'] ) )
{
$page = $_GET['page']-1;
$offset = $recLimit * $page;$page = $_GET['page']+1;
}
else
{
$page=2;
$offset = 0;
}
$phpself = $_SERVER['PHP_SELF'];
if( $totalPages <= $noofpages )
{
echo "Pages if less than or equal 5 : ";
for($i=1; $i <= $totalPages; $i++)
{
echo "<a href = \"$phpself?page=$i\">$i</a> |";
}
}
else
{
$i=1;
for($i; $i <= $totalPages; $i++)
{
echo "<a href = \"$phpself?page=$i\">$i</a> |";
}
}
?><table border="1" cellpadding="8"><tr> <th>ID</th><th>Name</th><th>Age</th><th>E-mail ID</th><th>Verified</th>
我要做一个 PHP 分页,但我有一些问题,我想显示 5 页和每页 4 条记录。如果我们点击下一个按钮,那么它会显示剩余的页面。总共有7页。