ASP分页,下一页无法取复选框的值

wsmhzyaba wsmhzyaba 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%dim action,searchkey,categoryid,jiage,shape,rs2,zkou,rs3,carat,caratpage
dim good,clar,cut,polish,tosay,arrows,zstype,fluore,bqj1,bqj2,goods
shape=request("shape")
good=request("good")
clar=request("clar")
cut=request("cut")
bqj1=request("bqj1")
bqj2=request("bqj2")
polish=request("polish")
tosay=request("tosay")
arrows=request("arrows")
zstype=request("zstype")
fluore=request("fluore")
categoryid=request.form("categoryid")
jiage=request.form("jiage")
action=request.QueryString("action")
searchkey=request.QueryString("searchkey")
if request("bqj1")<>"" then
caratpage=caratpage&"bqj1="&bqj1
end if
if request("bqj2")<>"" then
caratpage=caratpage&"&bqj2="&bqj2
end if

if categoryid="" then categoryid=request.QueryString("categoryid")
if jiage="" then jiage=request.QueryString("jiage")
if action="" then action=int(request.form("action"))
if searchkey="" then searchkey=trim(request.form("searchkey"))


%>
<%call sss()%>
<title><%=webname%>--商品搜索结果</title>
<!--#include file="include/header.asp"-->
<TABLE WIDTH="973" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" BGCOLOR=<%=bgclr1%>>
<TR><TD WIDTH="760" BGCOLOR=<%=bgclr1%> HEIGHT="22" ALIGN="CENTER">
<B><FONT COLOR="#FFFFFF">搜索结果</FONT></B></TD></TR></TABLE>
<table width="973" border="0" cellspacing="1" cellpadding="0" align="center" BGCOLOR=<%=bgclr1%>>
<tr> <td HEIGHT="200" VALIGN="TOP" BGCOLOR=<%=bgclr4%> WIDTH="100%"> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr> <td style="padding-left:6px"> <%if searchkey="" then
response.write "对不起,请您输入查询关键字"
response.End
else
response.write "您查询的关健字是:<font color=red>"&searchkey&"</font>"
end if%> </td></tr> </table><%'开始分页
Const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if

set rs=server.CreateObject("adodb.recordset")
if jiage="" then '//普通查询
select case action
case "1"
rs.open "select * from product where name like '%"&searchkey&"%' ",conn,1,1
case "2"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' ",conn,1,1
case "3"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' ",conn,1,1
case "4"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' ",conn,1,1
end select
else
'//高级查询

if categoryid<>0 then '//判断查询分类,分类不为空。
select case action
case "1"
rs3="select * from product where name like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "2"
rs3="select * from product where mark like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluore in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "3"
rs3="select * from product where introduce like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "4"
rs3="select * from product wheree detail='"&searchkey&"' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
end select
else
'//分类为空。

select case action
case "1"
rs3="select * from product where name like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if

if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluore in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "2"
rs.open "select * where mark like '%"&searchkey&"%' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
case "3"
rs.open "select * from product where introduce like '%"&searchkey&"%' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
case "4"
rs.open "select * from product where detail='"&searchkey&"' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
end select
end if
end if
...全文
评论 5
收藏 已收藏
分享
返回顶部
wsmhzyaba
ASP 28,401 成员 356,940 内容