📄 search.asp
字号:
<TBODY>
<TR>
<TD>
<table width=100% cellspacing="0" cellpadding="0" border="0">
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bigclass ",conn,1,1
if rs.recordcount=0 then
%>
<tr>
<td colspan=2 height="22">暂无分类</td>
</tr>
<%
else
i=0
while not rs.eof
%>
<tr>
<td align=right width=49% height="22" class="table-xia"><a href="shangpin.asp?bigclass=<%=rs("bigid")%>"><%=rs("bigclass")%></a></td>
<%rs.movenext
if rs.eof then
response.write "<td align=center> </td></tr>"
else
%>
<td align=left width=51% height="22" class="table-xia"> <font color="#666666">|</font> <a href="shangpin.asp?bigclass=<%=rs("bigid")%>"><%=rs("bigclass")%></a></td>
</tr>
<%
rs.movenext
end if%>
<%
wend
end if
%>
</table>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center
border=0><TBODY><TR>
<TD height=20> </TD>
</TR>
<TR>
<TD></TD></TR>
<TR>
<TD height=1></TD></TR>
<TR>
<TD height=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top borderColor=#ffffff
bgColor=#ffffff class=table-zuoyou>
<DIV align=center>
<TABLE class=table-shangxia cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD bgColor=#f2f2f2 height=23> 更多商品</TD>
</TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY></TBODY></TABLE><table width="560" border="0" align="center" cellpadding="1" cellspacing="1" class="txt1">
<%const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from newgoods where (name like '%"&key&"%'or content like '%"&key&"%' ) order by addtime desc"
rs.open sql,conn,1,1
if not rs.eof then
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"search.asp?key="&server.urlencode(key)
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"search.asp?key="&server.urlencode(key)
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"search.asp?key="&server.urlencode(key)
end if
end if
else
response.write "<tr><td width=100% colspan=3>没有找到 <font color=red>"&key&"</font> 相关资料,请重新搜索!</td></tr>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
sub showContent
i=0
%>
<tr>
<td width="100%" height="34" colspan="3">您搜索的关键字是:<font color=red><%=key%></font>,共找到结果 <font color=red><%=totalput%></font> 条</td>
</tr>
<%
do while not rs.eof and i<MaxPerPage
%>
<tr background="img/line1.gif">
<td colspan="3"><div align="center"><table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="6%" height="30" rowspan="2"> </td>
<td height="28"> </td>
<td width="18%" align="center"></td>
</tr>
<tr>
<td height="2" colspan="2" bgcolor="#6699cc"> </td>
</tr>
<tr>
<td height="24" align="center" ></td>
<td height="24" colspan="2" background="img/line1.gif" >
<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td rowspan="4" width="30%" class="table-xia">
<div align="center">
<table width="99" border="0" cellspacing="0" cellpadding="0" height="99">
<tr>
<td background="images/xt_bj.gif">
<div align="center"><img src="upload/<%=trim(rs("img"))%>" width=93 height="96" border=0></div></td>
</tr>
</table>
</div></td>
<td width="70%"><font color="#990000"><%=trim(rs("name"))%></font></td>
</tr>
<tr>
<td width="70%"><span class="style1">市场价:<s><font color=red><%=trim(rs("scprice"))%></font></s> 会员价:<font color=red><%=trim(rs("hyprice"))%></font><font color=red></font></span> </td>
</tr>
<tr>
<td width="70%"><a href="gouwu.asp?id=<%=rs("goodid")%>&action=add"><img src="image/goumai.gif" width="50" height="19" border=0></a> </td>
</tr>
<tr>
<td width="70%" class="table-xia"> <font color="#999999">
<%if len(trim(rs("content")))>50 then
response.write left(trim(rs("content")),50)&"...."
else
response.write trim(rs("content"))
end if%>
</font></td>
</tr>
</table></td>
</tr>
<tr >
<td height="22" colspan="3" align="center" > </td>
</tr>
</table></div> </td>
</tr>
<%i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if%>
<tr>
<td> </td>
<td width="77%" align="center" class="list6"><%
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a class=list3 href="&filename&"&page=1>首页</a> "
response.write "<a class=list3 href="&filename&"&page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a class=list3 href="&filename&"&page="&(CurrentPage+1)&">"
response.write "下一页</a> <a class=list3 href="&filename&"&page="&n&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>条 <b>"&maxperpage&"</b>条/页</font> "%></td>
<td width="19%" class="txt3"> </td>
</tr>
<%end function%>
</table>
</DIV> </TD>
</TR></TBODY></TABLE>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -