Home > Backend Development > PHP Tutorial > 一个分页有关问题

一个分页有关问题

WBOY
Release: 2016-06-13 13:12:57
Original
889 people have browsed it

求助一个分页问题
一面是一个淘宝的分页连接

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->

http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=0
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=40
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=80
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=120
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=160
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=200
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=240
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=280
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=320
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=360
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=400
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=440
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=480
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=520
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=560
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=600
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=640
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=680
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=720
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=760
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=800
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=840
http://s.taobao.com/search?style=grid&q=%C8%D5%BA%AB%B5%E7%D3%B0&initiative_id=staobaoz_20120807&style=list&s=880



Copy after login


我的问题是:
我们分页时一般都是page=1 ,page=2 ,page =3
而淘宝呢他们的分页是 s=0 ,s=40,s=80
我不明白的是TA为什么不s=1,s=2,s=3,以页码的方式展示呢?
后面为什么跟一个页面显示的数量呢??这样做的好处是什么哟???

后面我又看了一下baidu 他们的搜索与taobao差不多。
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
http://www.baidu.com/s?wd=%E6%8A%8A%E7%99%BE%E5%BA%A6%E8%AE%BE&pn=0&ie=utf-8
http://www.baidu.com/s?wd=%E6%8A%8A%E7%99%BE%E5%BA%A6%E8%AE%BE&pn=10&ie=utf-8
http://www.baidu.com/s?wd=%E6%8A%8A%E7%99%BE%E5%BA%A6%E8%AE%BE&pn=20&ie=utf-8

Copy after login



看了一下google,他们的搜索与taobao差不多。
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
http://74.125.128.105/#q=%E7%8B%97%E7%8B%97&hl=zh-CN&newwindow=1&prmd=imvns&ei=icwhULKWGYnYigfV3IC4Ag&start=10&sa=N&bav=on.2,or.r_gc.r_pw.&fp=389e782348690677&biw=1366&bih=619
http://74.125.128.105/#q=%E7%8B%97%E7%8B%97&hl=zh-CN&newwindow=1&prmd=imvns&ei=-NAhULOdEaeSiQedtIC4CA&start=20&sa=N&bav=on.2,or.r_gc.r_pw.&fp=389e782348690677&biw=1366&bih=619
http://74.125.128.105/#q=%E7%8B%97%E7%8B%97&hl=zh-CN&newwindow=1&prmd=imvns&ei=AdEhUM2WKauuiQei3ICoBg&start=30&sa=N&bav=on.2,or.r_gc.r_pw.&fp=389e782348690677&biw=1366&bih=619

 <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template