国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

程序員編寫分頁函數的方法

2024-05-04 11:05:07
字體:
來源:轉載
供稿:網友
當PHP程序員編寫程序代碼時,他們通常都會使用到分頁功能,代碼其實和編寫WORD文檔是一樣的,接下來就讓錯新技術小編帶大家來了解一下程序員編寫分頁函數的方法。
復制代碼 代碼如下:

<%
??????page=trim(request("page"))
??????maxperpage=40
??????first=true
??????last=true
??????dim?rs
??????set?rs=server.CreateObject("adodb.recordset")
??????sql="select?id,title,add1,cartype,isred,enterdate,hits?from?newnews?where?classtype=0?and?pass=1?order?by?id?desc"
rs.open?sql,conn,1,1
????????rs.pagesize=maxperpage
????????totalpage=rs.pagecount
????????if?len(page)=0?then
????????intpage=1
????????first=false
????????else
????????????if?cint(page)<=1?then
????????????intpage=1
????????????first=false
????????????else
????????????????if?cint(page)>=rs.pagecount?then
????????????????intpage=rs.pagecount
????????????????last=false
????????????????else
????????????????intpage=cint(page)
????????????????end?if
????????????end?if
????????end?if????????????
????????if?not?rs.eof?then
????????rs.absolutepage=intpage
????????end?if
????????for?a=1?to?maxperpage
????????if?rs.eof?then?exit?for
????????%>
??????????????response.write?"bgcolor=#ffffff"
??????else
??????response.write?"bgcolor=#f6f6f6"
??????end?if
??????%>>
??????????<%=a%>?


??????????
????????????<%add=rs("add1")
????????substring?add,4
????????%>
??????????
??????????
??????????"?target="_blank">??????????
?????????<%
????????if?rs("isred")=True?then
????????%>
????????
????????<%title=rs("title")
????????substring?title,20
????????%>
????????<%else
????????title=rs("title")
????????substring?title,20
????????%>
????????<%
????????end?if
????????%>????????
????????
??????????<%=rs("cartype")%>
??????????
??????????????<%thetime=rs("enterdate")
????????????????????themon=datepart("m",thetime)
????????????????????if?len(themon)<2?then?themon="0"&themon
????????????????????theday=datepart("d",thetime)
????????????????????if?len(theday)<2?then?theday="0"&theday
????????????????????ther=themon&"-"&theday
????????????????????response.write?ther
????????????????%>
??????????
??????????<%=rs("hits")%>
????????
????????<%
??????rs.movenext
??????if?rs.eof?then?exit?for
??????next????????
??????%>
??????
??????
??????
????????
??????
????
?????
????????????
??????????????
??????????????????
????????????????????<%if?rs.pagecount>0?then?%>
??????????????共有<%=rs.recordcount%>條|當前頁<%=intpage%>/
??????????????<%

=rs.pagecount%>

??????????????<%?end?if?%>
??????????????<%if?intpage>1?then%>
??????????????
?

page=1">首頁
??????????????<%else%>
??????????????首頁
??????????????<%end?if%>
??????????????<%if?first?then%>
??????????????
?

page=<%=intpage-1%>">上一頁
??????????????<%else%>
??????????????上一頁
??????????????<%end?if%>
??????????????<%if?last?and?intpage
??????????????
?

page=<%=intpage+1%>">下一頁
??????????????<%else%>
??????????????下一頁
??????????????<%end?if%>
??????????????<%if?intpage
??????????????
?

page=<%=rs.pagecount%>">尾頁
??????????????<%else%>
??????????????尾頁
??????????????<%end?if%>
??????????????轉到
??????????????
[this.selectedIndex].value">
????????????????<%for?b=1?to?rs.pagecount
?????if?b=intpage?then%>
?????????????????page=<%=b%>"?selected>

????????????????第<%=b%>頁
????????????????<%?else?%>
?????????????????page=<%=b%>">第<%=b%>頁

????????????????
????????????????<%end?if
?????next%>
??????????????
????
????????????
??????????

<%
rs.close
set?rs=nothing
conn.close
set?conn=nothing
%>
?>?then%>?>?then%>?>?>?>

通過錯新技術頻道小編介紹的程序員編寫分頁函數的方法,相信大家都有了一定的了解,如需了解更多的相關資訊,請繼續關注錯新技術頻道吧!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盐边县| 阿巴嘎旗| 横峰县| 万源市| 江陵县| 海晏县| 江西省| 咸阳市| 白沙| 格尔木市| 星子县| 手游| 绥棱县| 商洛市| 井冈山市| 巴南区| 林口县| 西林县| 南康市| 三门县| 兴海县| 诸暨市| 德惠市| 民乐县| 永登县| 枣强县| 安阳市| 栾城县| 荔浦县| 岳池县| 康乐县| 张北县| 都兰县| 长海县| 苍南县| 深州市| 新乐市| 建瓯市| 新巴尔虎右旗| 比如县| 丹东市|