The newly written paging Function
Solution
I used to find a paging function or a class. As a result, I found it easy to use online for a long time. it took me 10 minutes to get a page. it's easy to comment on .... (Later, I saw something similar to google and Baidu ....) /* Paging Functions
$ Num: Total number of articles
$ P: Current page number
$ Q: the content of the current search
$ Str: url parameter (what follows the question mark)
$ Pn: number of entries displayed per page
{Fl ($ num, $ p, $ q, $ pn )}
*/
Function fy ($ num, $ p, $ str = '? Mod = zzwla & dosubmit = 1', $ q = '', $ pn = 10)
{
If (empty ($ num) return false;
$ Ps = ceil ($ num/$ pn );
$ Q = $ q? '& Q ='. urlencode ($ q ):'';
If ($ p> 1)
Echo 'previous page ';
If ($ ps <15)
For ($ I = 1; $ I <15; ++ $ I)
{
If ($ I <= $ ps)
Echo ''. $ I.'') :( 'page "> '. $ I .'')).'';
}
Else
For ($ I = $ p7; $ I <$ p + 7; ++ $ I)
{
If ($ I> 0 & $ I <= $ ps)
Echo ''. $ I.'') :( 'page "> '. $ I .'')).'';
}
If ($ p! = $ Ps)
Echo 'Next page ';
}
Copy the following code:
[]
Attachment: you cannot download or view attachments in your user group.
D8888D reply content
Look at the paging class written by old ghost
[Url = http://bbs.phpchina.com/viewthread.php? Tid = 29479 & highlight = % B7 % D6 % D2 % B3] link tag http://bbs.phpchina.com/viewthre... hlight = % B7 % D6 % D2 % B3 [/url]
D8888D reply content
Read it. It's a long character.
You can quickly implement the function.
D8888D reply content
I use the <> icon in the editor. During preview, only one [CODE] tag is added to both ends of the CODE.
D8888D reply content
Thank you!
D8888D reply content
Thank you for sharing @!
D8888D reply content
Used
Pai_^
[Img] http://www.phpchina.com/bbs/images/smilies/default/lol.gif#/img]