人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

模仿PHP寫的ASP分頁

模仿PHP寫的ASP分頁

更新時(shí)間:2022-08-15 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

<%
' 分頁程序
' total_records 總記錄數(shù)
' everypage_records 每頁顯示條數(shù)
' current_page 當(dāng)前頁數(shù)
' url 要傳遞的url,這里可以含有要傳遞的變量,比如 "list.asp?" 或者"list.asp?keyword=key&"
' 程序調(diào)用比較簡(jiǎn)單,不過還是比PHP的麻煩,繼續(xù)努力中

sub show_page(total_records,everypage_records,current_page,url)

 if IsNumeric (total_records) then
  total_records=Int(total_records)
 else
  total_records=0
 end if
 
 if IsNumeric (everypage_records) then
  everypage_records=Int(everypage_records)
  if everypage_records<=0 then
   everypage_records=10
  end if
 else
  everypage_records=10
 end if
 
 if IsNumeric (current_page) then
  current_page=Int(current_page)
 else
  current_page=1
 end if
 
 '取總頁數(shù),即最后一頁
 if total_records mod everypage_records=0 then
  last_page=Int(total_records/everypage_records)
 else
  last_page=Int(total_records/everypage_records)+1
 end if
 
 '判斷 current_page 是否符合標(biāo)準(zhǔn),并附值給page
 if current_page>=last_page then
  page=last_page
 elseif current_page<=1 then
  page=1
 else
  page=current_page
 end if
 
 '上一頁
 if page<=0 then
  prepg=0
 else
  prepg=page-1
 end if
 '下一頁
 if page=last_page then
  nextpg=0
 else
  nextpg=page+1
 end if
 
 '本頁開始記錄
 firstcount=prepg*everypage_records
 '本頁結(jié)束記錄
 if nextpg>=1 then
  lastcount=(nextpg-1)*everypage_records
 else
  lastcount=total_records
 end if
 '開始分頁導(dǎo)航條代碼
 pagenav=""
 pagenav1=""
 pagenav=pagenav&"顯示第<b>"&firstcount&"-"&lastcount&"</b>條記錄 共<b>"&total_records&"</b> 條記錄"
 pagenav1=pagenav1&"顯示第<b>"&firstcount&"-"&lastcount&"</b>條記錄 共<b>"&total_records&"</b> 條記錄"
 
 if last_page>1 then
 '當(dāng)有前后頁時(shí)
 pagenav=pagenav&" <a href='"&url&"page=1'>首頁</a> "
 pagenav1=pagenav1&" <a href='"&url&"page=1'>首頁</a> "
 if prepg>=1 then
  pagenav=pagenav&" <a href='"&url&"page="&prepg&"'>前頁</a> "
  pagenav1=pagenav1&" <a href='"&url&"page="&prepg&"'>前頁</a> "
 else
  pagenav=pagenav&" 前頁 "
  pagenav1=pagenav1&" 前頁 "
 end if
 if nextpg>=1 then
  pagenav=pagenav&" <a href='"&url&"page="&nextpg&"'>后頁</a> "
  pagenav1=pagenav1&" <a href='"&url&"page="&nextpg&"'>后頁</a> "
 else
  pagenav=pagenav&" 后頁 "
  pagenav1=pagenav1&" 后頁 "
 end if
 pagenav=pagenav&" <a href='"&url&"page="&last_page&"'>尾頁</a> "
 pagenav1=pagenav1&" <a href='"&url&"page="&last_page&"'>尾頁</a> "
 
 pagenav=pagenav&"到第<input type=text name=text100 id=text100 value="&page&" size=3>頁<input type=button name=button100 value=go onclick='window.location="""&url&"page=""+text100.value'>"
 pagenav=pagenav&" 共 "&last_page&" 頁"

 pagenav1=pagenav1&"到第<input type=text name=text101 id=text101 value="&page&" size=3>頁<input type=button name=button101 value=go onclick='window.location="""&url&"page=""+text101.value'>"
 pagenav1=pagenav1&" 共 "&last_page&" 頁"
 end if

end sub
%>

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 越西县| 舟山市| 登封市| 云梦县| 百色市| 石首市| 阳春市| 岳阳县| 安仁县| 保亭| 北京市| 深水埗区| 墨竹工卡县| 民和| 什邡市| 抚松县| 若尔盖县| 溧阳市| 瑞丽市| 虹口区| 贞丰县| 华阴市| 宜兴市| 舒城县| 五华县| 临武县| 东安县| 上饶县| 宜宾县| 安福县| 新兴县| 铜鼓县| 太原市| 厦门市| 高碑店市| 剑川县| 怀集县| 吉首市| 遂平县| 涡阳县| 新龙县|