Ask a question about pagination

WBOY
Release: 2016-08-20 09:04:09
Original
916 people have browsed it

This paging is based on the query condition of $name. I would like to ask if the link to the page number of this paging is hard-coded during the first query? For example, when clicking on the second page, the query condition $name was not submitted. If the following if judgment is used, wouldn't $name be empty? There is no way to click on the second page. Is it like what I said at the beginning that the URLs of all page numbers have been generated during the first query, so there is no need to query based on the query conditions?

<code>$name = isset($_REQUEST['name'])? $_REQUEST['name'] : '';
$page = isset($_REQUEST['page'])? $_REQUEST['page'] : 1;</code>
Copy after login
Copy after login
<code>'<li"><a  href="'.$_SERVER["SCRIPT_NAME"].'?page='.$i.'&name='.$name.'">'.($i).'<a></li>'</code>
Copy after login
Copy after login

Reply content:

This paging is based on the query condition of $name. I would like to ask if the link to the page number of this paging is hard-coded during the first query? For example, when clicking on the second page, the query condition $name was not submitted. If the following if judgment is used, wouldn't $name be empty? There is no way to click on the second page. Is it like I said at the beginning that the URLs of all page numbers have been generated during the first query, so there is no need to query based on the query conditions?

<code>$name = isset($_REQUEST['name'])? $_REQUEST['name'] : '';
$page = isset($_REQUEST['page'])? $_REQUEST['page'] : 1;</code>
Copy after login
Copy after login
<code>'<li"><a  href="'.$_SERVER["SCRIPT_NAME"].'?page='.$i.'&name='.$name.'">'.($i).'<a></li>'</code>
Copy after login
Copy after login

Yes, it is generated on the first query

You can use paging controls.

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template