有人能帮助我吗?我相信这对你们来说很容易。我正在努力寻找在没有页面显示我的代码时如何隐藏下一个链接的解决方案,如下所示:
if (!isset($_GET['page']) or !is_numeric($_GET['page'])) {
$page = 0;
} else {
$page = (int)$_GET['page'];
}
$pages_query=mysql_query ("SELECT COUNT * FROM hardware");
$result = mysql_query("SELECT * FROM hardware LIMIT $page, 3");
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.($page+3).'">Next</a><p>';
$prev = $page - 3;
//only print a "Previous" link if a "Next" was clicked
if ($prev >= 0) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?page='.$prev.'">Previous</a>';
}