Ec (2); function_pageft ($ totle, $ displaypg20, $ url) {& nbsp; global $ page, $ firstcount, $ pagenav, $ _ server; & nbsp; & nbsp; $ globals [& quot; displaypg & quot;] $ displaypg; & nbsp; if (! Script ec (2); script
Function _ pageft ($ totle, $ displaypg = 20, $ url = ''){
Global $ page, $ firstcount, $ pagenav, $ _ server;
$ Globals ["displaypg"] = $ displaypg;
If (! $ Page)
$ Page = 1;
If (! $ Url ){
$ Url = $ _ server ["request_uri"];
}
// Url analysis:
$ Parse_url = parse_url ($ url );
$ Url_query = $ parse_url ["query"]; // retrieve the query string of the url separately.
If ($ url_query ){
$ Url_query = ereg_replace ("(^ | &) page = $ page", "", $ url_query );
$ Url = str_replace ($ parse_url ["query"], $ url_query, $ url );
If ($ url_query)
$ Url. = "& page ";
Else
$ Url. = "page ";
} Else {
$ Url. = "? Page ";
}
$ Lastpg = ceil ($ totle/$ displaypg); // The last page, also the total number of pages
$ Page = min ($ lastpg, $ page );
$ Prepg = $ page-1; // Previous page
$ Nextpg = ($ page = $ lastpg? 0: $ page + 1); // next page
$ Firstcount = ($ page-1) * $ displaypg;
// Start the paging navigation bar code:
$ Pagenav = "display". ($ Totle? ($ Firstcount + 1): 0 )."-". Min ($ firstcount + $ displaypg, $ totle )."A total of $ totle records ";
Homepage 1 2 3 4 last