⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trsearch.asp

📁 网络商城系统
💻 ASP
字号:
<!--#include file="top.asp"-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> 
<tr> 
  <td width="180" valign="top">
<table width="761" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FE9ACE">
      <tr> 
        <td width="180" valign="top"><!--#include file="left.asp"--></td>
        <td width="580" valign="top" bgcolor="#FFFFFF"> 
          <table width="2" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
            <tr> 
              <td height="3"></td>
            </tr>
          </table>
          <div align="center"><img src="images/list.gif" width="578" height="24"> 
          </div>
          <table width="580" height="42" border="0" cellpadding="0" cellspacing="0">
            <tr> 
              <td valign="top"> 
                <%

   page=request.querystring("page")
  if page="" then page=1
  if not(isnumeric(page)) then page=1
  if page<1 then page=1
  page=int(page)
			word=request("keyword")
			if word="" then
			response.write"<script language=javascript>alert('关键字不能为空');this.location.href='javascript:history.go(-1)';</script>"					
			response.end
			end if
			set rs=server.createobject("adodb.recordset")
			sql="select * from goods where sp_name like '%"&word&"%' order by id desc"
			rs.open sql,conn,1,1
			if rs.eof then
			response.write"<br><br><div align=center>暂时没有此商品</div><br><br>"
			else
			rs.pagesize=8
      totalrec=rs.recordcount
      totalpage=rs.pagecount
      if page>totalpage then page=totalpage
      rs.absolutepage=page
      i=0
	   dim id(),sp_name(),marprice(),memprice(),sp_pic()
      do while not rs.eof and (i<rs.pagesize)
      i=i+1
      redim preserve id(i),sp_name(i),marprice(i),memprice(i),sp_pic(i)
	  id(i)=rs("id")
      sp_name(i)=rs("sp_name")
      marprice(i)=rs("marprice")
      memprice(i)=rs("memprice")
	  sp_pic(i)=rs("sp_pic")
      rs.movenext
      loop
  
  rs.close
			%>
                <br> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr> 
                    <% 
				  for i=1 to ubound(id)%>
                    <td> <table width="246" height="80" border="0"  cellpadding="0" cellspacing="0">
                        <tr> 
                          <td width="80" height="80" rowspan="4"><a href="goods.asp?id=<%=id(i)%>"><img class="border3" border="0" src="<%=sp_pic(i)%>" width="80" height="80"></a></td>
                          <td><div align="center"><a href="goods.asp?id=<%=id(i)%>"><font style="text-decoration:underline;color:#FF20AB"><%=sp_name(i)%></font></a></div></td>
                        </tr>
                        <tr> 
                          <td><div align="center">市场价:<s><%=marprice(i)%></s>元</div></td>
                        </tr>
                        <tr> 
                          <td><div align="center">会员价:<%=memprice(i)%>元</div></td>
                        </tr>
                        <tr> 
                          <td><div align="center"><a href="goods.asp?id=<%=id(i)%>"><img border="0" src="images/look.gif" width="58" height="22"></a></div></td>
                        </tr>
                      </table></td>
                    <% if i mod 2=0 then%>
                  </tr>
                  <tr>
                    <td height="50"></td>
                  </tr>
                  <%
		end if
			next
			%>
                </table>
                <br> <table border="0" width="507" cellspacing="0" height="10" align="center">
                  <tr> 
                    <td> <p align="center">共<font color=red><%=totalpage%></font>页  
                        第<%=page%>页 <font color=666666>   
                        <%if page-1>0 then%>
                        <a href="trsearch.asp?page=<%=page-1%>&keyword=<%=word%>"><font color="#000000">上一页</font></a> 
                        <%else%>
                        <font color=666666>上一页</font> 
                        <%end if%>
                          
                        <%if page+1<=totalpage then%>
                        <a href="trsearch.asp?page=<%=page+1%>&keyword=<%=word%>"><font color="#000000">下一页</font></a> 
                        <%else%>
                        <font color=666666>下一页</font> 
                        <%end if%>
                         共<font color=red><%=totalrec%></font>条记录 </font></p></td>
                  </tr>
                  <tr> 
                    <td></td>
                  </tr>
                </table>
                <br> 
                <%
				end if
set rs=nothing
conn.close
set conn=nothing
%>
              </td>
            </tr>
          </table>
          <div align="center"> <br>
          </div></td>
		  
        <td width="4" valign="top"><br>
        </td>
      </tr>
    </table>
    <!--#include file="bottom.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -