%
Server.ScriptTimeOut=90
ON ERROR RESUME NEXT
Response.ExpiresAbsolute =Now() - 1
Response.Expires=0
Response.CacheControl="no-cache"
const MaxPerPage=20
dim sjs1,serph,Tname,dhname,fwfh
'---------
fwfh=fwwzjc("/inc/fwpbip1.txt","")
if fwfh="ER_0" then
response.end
end if
'----------
khdfs=0
if isMobile()=true then
khdfs=1
end if
'----------
dim totalPut,CurrentPage,TotalPages,i,j,keyword,classid,Tnamez
keyword=request("keyword")
Tnamez=keyword
classid=request("classid")
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
Tname=""
dhname=""
if keyword<>"" then
Tname=keyword&"_"
dhname=" >> 查询:“"&keyword&"”"
end if
%>
<%=Tname%>菜谱大全
<% if khdfs=0 then %>
<% else %>
<% end if %>
<% if khdfs=0 then %>
<% else %>
<% end if %>
"
response.end
end if
if keyword="" then
response.write "
您还没有输入查询条件。
"
else
keyword=replace(replace(replace(keyword,"'","‘"),"<","<"),">",">")
sql=""
if classid="" then
sql=" InStr(1,LCase(title),LCase('"&keyword&"'),0)<>0 "
else
sql=" ( InStr(1,LCase(title),LCase('"&keyword&"'),0)<>0 and classid="& request("classid")&" ) "
end if
dim sqlzs,fzd
fzd=" articleid,title,content,classid "
sqlzs = "SELECT articleid FROM [article] WHERE " & sql
%>
<%
set rs = server.CreateObject ("adodb.recordset")
rs.open sqlzs ,conn,1,1
if rs.bof and rs.eof then
else
totalPut=rs.recordcount
totalnumber=rs.recordcount
end if
rs.close
if CurrentPage=1 then
sql="SELECT top "&MaxPerPage& fzd &" FROM [article] WHERE "&sql & " order by articleid desc" '总页码为1取当前页
else
sqlzs="(select top "&((CurrentPage-1)*MaxPerPage)&" articleid FROM [article] WHERE "&sql '使用组合查询方式
sql="SELECT top "&MaxPerPage& fzd &" FROM [article] WHERE articleid<(select min(articleid) from "&sqlzs&" order by articleid desc) AS T ) and "&sql&" order by articleid desc"
end if
dim ares
rs.open sql,conn,1,1
dim ls_jlzs
if rs.eof or rs.bof then
ls_jlzs=0
else
ares = rs.GetRows
ls_jlzs=UBound(ares, 2)
end if
rs.close
conn.close
set conn=nothing
if (ls_jlzs<=0 or ls_jlzs="") then
response.write "
"
else
if (totalPut mod MaxPerPage)=0 then
Pcount= totalPut \ MaxPerPage
else
Pcount= totalPut \ MaxPerPage + 1
end if
if currentpage > Pcount then currentpage = Pcount
if currentpage<1 then currentpage=1
j=(currentpage-1)*MaxPerPage+1
response.write "