%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<% Response.Charset="UTF-8"%>
<%
dim keyword,kind
keyword=request.QueryString("keyword")
kind=request.QueryString("kind")
set rs=server.CreateObject("adodb.recordset")
if kind<>"" then
sql="select * from YK_Products where P_KeyWords like '%"&keyword&"%' and P_Type="&kind&" order by P_Date desc"
url="keyword="&keyword&"&kind="&kind&"&page1="
else
sql="select * from YK_Products where P_KeyWords like '%"&keyword&"%' order by P_Date desc"
url="keyword="&keyword&"&kind="&kind&"&page1="
end if
rs.open sql,conn,1,1
'設置分頁,設置分頁條件
rs.pagesize=5
dim nowpage
nowpage=request.QueryString("page1")
if not isnumeric(nowpage) then
nowpage=1
elseif clng(nowpage)<1 then
nowpage=1
elseif clng(nowpage)>cint(rs.pagecount) then
nowpage=rs.pagecount
end if
if not rs.eof then
if nowpage="" then
rs.absolutepage=1
else
rs.absolutepage=nowpage
end if
end if
%>
您當前的位置是:相關產品—><%=keyword%>
搜索結果
- 首頁
<%
dim pagebef
if cint(nowpage)<2 then
pagebef=nowpage
else
pagebef=cstr(cint(nowpage)-1)
end if
%>
- 上一頁
<%
if cint(rs.pagecount)<=5 then
for i=1 to cint(rs.pagecount)
%>
- <%=i%>
<%
next
else
if cint(nowpage)<5 then
for i= 1 to 5
%>
- <%=i%>
<%next
elseif cint(nowpage)>=5 and cint(nowpage)<=cint(rs.pagecount)-2 then
for i=cint(nowpage)-2 to cint(nowpage)+2
%>
- <%=i%>
<%
next
elseif nowpage>=cint(nowpage)-2 then
for i=cint(rs.pagecount)-5 to cint(rs.pagecount)
%>
- <%=i%>
<%
next
end if%>
<%
end if
dim pageaft
if cint(nowpage)>=cint(rs.pagecount) then
pageaft=nowpage
else
pageaft=cstr(cint(nowpage)+1)
end if
%>
- 四川金7乐助手下一载
- 末頁
- 共<%=rs.pagecount%>頁,當前頁:<%=nowpage%>
<%
call close_conn
%>