Home >Backend Development >PHP Tutorial >Ask a question about pagination

Ask a question about pagination

WBOY
WBOYOriginal
2016-08-20 09:04:09939browse

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>
<code>'<li"><a  href="'.$_SERVER["SCRIPT_NAME"].'?page='.$i.'&name='.$name.'">'.($i).'<a></li>'</code>

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>
<code>'<li"><a  href="'.$_SERVER["SCRIPT_NAME"].'?page='.$i.'&name='.$name.'">'.($i).'<a></li>'</code>

Yes, it is generated on the first query

You can use paging controls.

Statement:
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