【发布时间】:2014-06-29 14:52:54
【问题描述】:
我刚刚在我的网站上添加了 php 分页,但我无法链接到正确的页面。
背景信息:
人们可以在“example.com/bikebrands.php”页面上选择自行车品牌。 因此,当他们选择“Bianchi”时,它会打开网页“example.com/bikebrands/bianchi”,其中列出了在我的数据库中找到的该品牌的所有相关新闻帖子。
我必须设置一个目标页面才能使分页工作。我选择了“/bikebrands”,但这不正确。 应该是:
$targetpage = "/bikebrands/**(echo row "bike brand" from database depending on the bike brand the visitor has selected)**?page=2";
所以当有人打开时:
example.com/bikebrands/bianchi 并点击“下一步”,它应该会加载example.com/bikebrands/bianchi?page=2
当有人打开时:
example.com/bikebrands/trek 并点击“下一步”,它应该会加载 example.com/bikebrands/trek?page=2
页面example.com/bikebrands/bianchi?page=2存在,所以url本身没有问题,只是我没有设法链接到那个页面。
我怎样才能做到这一点?
【问题讨论】:
标签: php pdo hyperlink pagination target