<% 'Page Program' Total_Records Total Document Number 'Everypage_Records Each page The number of the number of the number of the number' current_page current page 'URL To pass the URL, this can be included, such as "List.asp?" Or "list.asp? Keyword = key & "The program call is relatively simple, but it is still more than PHP, continue to work hard.
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 'take the total number of pages, i.e., the last page 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 determines whether the standard, along with the value to the page if current_page> = last_page then page = last_page elseif current_page <= 1 then page = 1 else page = current_page end if' Previous if page <= 0 then prepg = 0 else prepg = Page-1 END IF 'Next IF Page = Last_Page Then nextpg = 0 else nextpg = Page 1 END IF' This page Start Record firstcount = prepg * everypage_records' This page ends record if nextpg> = 1 Then Lastcount = (NextPG-1) * Everypage_Records else Lastcount = Total_Records end if 'starts paging navigation bar code PAGENAV = "Pagenav1 =" Pagenav = Page NAV & "Display By " & firstcount & "-" & LastCount & " B> " & Total_Records & " B> record" Pagenav1 = Pagenav1 & "Display Book " & Firstcount & "-" & Lastcount & " b> strip record a total of "& total_records &" <>> 条 record "if Last_page> 1 THEN 'When there is a front and rear page PAGENAV = Pagenav &" "Pagenav1 = Pagenav1 &" Home " if prepg> = 1 THEN PAGENAV = Pagenav & " Previous page " Pagenav1 = Pagenav1 & " Back page "Pagenav1 = Pagenav1 &" page "else pagenav = Pagenav &" Rear page "Pagenav1 = Pagenav1 &" Back "end if Pagenav = Pagenav &"
pagenav1 = pagenav1 & "to the second page "Pagenav1 = Pagenav1 &" & Last_page & "End IFEND SUB%>