当前位置:Gxlcms > PHP教程 > 一个分页有关问题

一个分页有关问题

时间:2021-07-01 10:21:17 帮助过:5人阅读

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

PHP code


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





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

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

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




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

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

                     

人气教程排行