The url-based parameter passing method may have a certain impact or a known bug. this time, we made some extensions and were compatible with the previous mode that originally published a paging class out of the database, recently, I found that sometimes when the search is too large, the url-based parameter passing method may have a certain impact or a known bug. this time, I made some extensions, at the same time, it is compatible with the previous mode. the above is simple. you only need to set one more parameter and the code is as follows:
The code is as follows:
/**
* Function: Paging class, based on the total amount of data provided and page size
* Creation Date: Fri Apr 20 16:45:21 CST 2007
* Last update:
* Author: sanshi
*/
Class pagination
{
Var $ result = array ();
Var $ pVar = "myp"; // page parameter page count
Var $ urlParamStr = ""; // All parameters on the page
Var $ sqlMoveNumber = 0; // data offset
Var $ is_post = false;
Public function pagination ()
{
}
Public function set ($ sum, $ pageSize, $ page = "", $ is_post = false)
{
$ This-> is_post = $ is_post;
$ This-> pVar = defined ('page _ bar ')? PAGE_BAR: 'myp ';
$ Url = $ _ SERVER ['php _ SELF '].'? '. $ _ SERVER ['query _ string'];
// Calculate the total number of pages
$ CurPage = $ this-> getCurPage ();
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service