Want to add home and last page on pagination

Source: Internet
Author: User
 
  ";}  else{  echo "";  }    if ($row [' Surplus ']==0)     $ss = "not selectable"; else $ss = "optional";      echo "  ". $row [' id ']. "".   $row [' Subject ']. "       ". $row [' Teacher ']. "       ". $row [' Zhicheng ']. "       ". $row [' number ']. "   ". $row [' Xuehao ']. "  ". $ss. "  View   ";   $n + +;   }      ? >


Reply to discussion (solution)

The content is wrong, the bottom should be the content of the page, want to add a home and last

 
                             There are currently ". $count." Record     total ". $pages." Page ", if ($offset) {   $preoffset = $offset-$list _num;print" Previous page ";} else {  echo "prev";}   $newoffset = $offset + $list _num;if (($pages!=0) && (($newoffset/$list _num)! = $pages)) {print ("next page");} else{Echo "Next page";}    $pageno = ($offset/$list _num) +1;echo "sectionPage       ";?>     

Print "first page prev";}

Print ("Next page last");

Actually, two print statements do not have the same wording ... Oh, there's a lot of room for improvement

Print "first page prev";}

Print ("Next page last");

Actually, two print statements do not have the same wording ... Well, there's a lot of room for progress. On the last question I would like to ask, join my list of 6 Also, I added the last statement, after the "last", the system does not show the 6th page of the content, but only display a list header, and on the () page is displayed on page (6.666667), what is this?

Your total page count is your last number.
The total number of pages you have here is $pages, so the last count is $pages
You should figure this out, if you have a decimal point, you want +1.
$pages =ceil ($count/$list _num); Here the total number of pages is correct, but to judge $list_num can't be 0 OH

Your total page count is your last number.
The total number of pages you have here is $pages, so the last count is $pages
You should figure this out, if you have a decimal point, you want +1.
$pages =ceil ($count/$list _num); Here the total number of pages is correct, but to judge $list_num can not be 0 oh sorry I am a rookie, so I want to add a question, I this $list_num is before the definition is equal to 30, why should judge not be 0? And what should I do with my last statement? If I write > last, it jumps to page (1.2).


Your total page count is your last number.
The total number of pages you have here is $pages, so the last count is $pages
You should figure this out, if you have a decimal point, you want +1.
$pages =ceil ($count/$list _num); Here the total number of pages is correct, but to judge $list_num can not be 0 oh sorry I am a rookie, so I want to add a question, I this $list_num is before the definition is equal to 30, why should judge not be 0? And what should I do with my last statement? If I write > last, it jumps to page (1.2).

Well, it's just a definition, but how do you figure out the decimals? Ceil, this is an integer.

$pageno = ($offset/$list _num) +1;
Why do you have to count this one?
The default in your text box should not be the current page? Even if it's not the current page, shouldn't this be a re-calculation? Even if you want to recalculate, you have to take an integer.

PHP Page Header There is a large section of comment description, how to find out where it was written,
the contents of the comment are as follows:
* @copyright: Copyright 2006 FEIFENGXLQ * @license: Version 2.0 * @create: 2006-5-31 * @modify: 2006-6-1 * @modify: FEIFENGXLQ 2006-11-4 * Description: Ultra-strong paging class, four paging modes, default to similar baidu,google-like paging style. * 2.0 added Features: Support custom style, custom style, support PHP4 and ...

$pageno = ($offset/$list _num) +1;
Why do you have to count this one?
The default in your text box should not be the current page? Even if it's not the current page, shouldn't this be a re-calculation? Even if you want to recalculate, you have to take an integer. Is that what I should get rid of?

$pageno = ($offset/$list _num) +1;
and change page $pageno to page $pages?

$pageno =floor (($offset/$list _num) +1); Change it to this.

$pageno =floor (($offset/$list _num) +1); It's changed to this. Well, I'm jumping to the last page, but the last page only shows the header of the list.

$pageno = Ceil ($offset/$list _num);

Ceil gets the smallest integer greater than or equal to $offset/$list _num

$pageno = Ceil ($offset/$list _num);

Ceil get the smallest integer greater than or equal to $offset/$list _num Well, the problem is, the 1th page shows the No. 0 page, I still don't want to go to the last feature.

  • Related Article

    Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.