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

📄 search.asp

📁 个人网站模板
💻 ASP
字号:
<%@ ENABLESESSIONSTATE = FALSE %>
<!--//#include file="top.htm"-->
<!--#include file="config.asp" -->
<!--#include file="jah0b1e/conn.asp" -->
<html>
<head>
<%
dim key
if Request.QueryString("key")="" then
Response.Redirect"info.asp?info=请输入关键字"
else
key=Request.QueryString("key")
end if
%>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="sys.css" rel="stylesheet" type="text/css">
</head>
<body text="#000000" leftmargin="0" topmargin="0">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr><td colspan="3"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
        <tr> 
          <td height="24" bgcolor="#000000"> <div align="center"><a href="index.asp"><font color="#FFFFFF">首页</font></a> 
              <font color="#FFFFFF">|</font></div></td>
          <td bgcolor="#000000"> <div align="center"><a href="product.asp"><font color="#FFFFFF">作品展示</font></a><font color="#FFFFFF">|</font></div></td>
          <%
sql = "SELECT * FROM index_type ORDER BY id ASC" 
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,0,1
if rs.eof and rs.bof then
Response.Write"主栏目还没有分类"
else
do while not rs.eof %>
          <td bgcolor="#000000"> <div align="center"><a href='index_type.asp?typeid=<%=rs("id")%>&type_name=<%=rs("name")%>'><font color="#ffffff"><%=rs("name")%></font></a> 
              <font color="#FFFFFF">|</font></div></td>
          <%
rs.movenext
loop
end if
rs.close
Set rs=Nothing
%>
          <td bgcolor="#000000"> <div align="center"><a href="forum/index.asp"><font color="#FFFFFF">设计论坛</font></a> 
              <font color="#FFFFFF">|</font></div></td>
          <td bgcolor="#000000"> <div align="center"><a href="contact_us.asp"><font color="#FFFFFF">留言本</font></a></div></td>
        </tr>
      </table></td></tr>
  <tr> 
    <td height="245" align="center" valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="200" height="229" valign="top" bgcolor="#666666"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <form name="form1" method="get" action="search.asp">
                <tr align="center"> 
                  <td width="200" height="40"> 
                    <div align="left"> 
                      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr> 
                          <td colspan="3">&nbsp;</td>
                        </tr>
                        <tr> 
                          <td width="3%"><div align="left"> </div></td>
                          <td width="71%"><div align="center">
                              <input type="text" name="key" size="15">
                            </div></td>
                          <td width="26%"> <div align="center">
                              <input type="submit" name="Submit" value="搜索">
                            </div></td>
                        </tr>
                      </table>
                    </div></td>
              </tr>
            </form>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" height="127">
              <tr> 
                <td width="100%" height="125"> <div align="center"> 
                    <table width="100%" border="0" cellspacing="0" cellpadding="3">
                      <tr> 
                        <td height="1" colspan="2" bgcolor="#FFFFFF" background="images/line2.gif"></td>
                      </tr>
                      <tr> 
                        <td width="15%"> <div align="left"><img src="images/to.gif" width="11" height="13"> 
                          </div></td>
                        <td width="84%"><a href="product.asp"><font color="#FFFFFF">作品展示</font></a></td>
                      </tr>
                    </table>
                    <%
sql = "SELECT * FROM type ORDER BY id ASC" 
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,Conn,0,1
if rs.eof and rs.bof then
Response.Write"还没有分类"
else
do while not rs.eof %>
                    <table width="100%" border="0" cellpadding="3" cellspacing="0">
                      <tr> 
                        <td height="1" colspan="2" bgcolor="#FFFFFF" background="images/line2.gif"></td>
                      </tr>
                      <tr> 
                        <td width="15%"> <div align="left"><img src="images/to.gif" width="11" height="13"> 
                            <br>
                          </div></td>
                        <td width="87%"><a href='type.asp?typeid=<%=rs("id")%>&classview=<%=rs("classview")%>&width=<%=rs("classbig")%>&type_name=<%=rs("name")%>'><font color="#FFFFFF"><%=rs("name")%></font></a></td>
                      </tr>
                    </table>
                    <%
rs.movenext
loop
end if
rs.close
Set rs=Nothing
%>
                  </div></td>
              </tr>
              <tr> 
                <td height="1" background="images/line2.gif" bgcolor="#FFFFFF"></td>
              </tr>
            </table>
          </td>
		  <td background="images/line1.gif"><img src="images/line1.gif" width="1" height="6"></td>
          <td width="570" valign="top"> 
            <table width='100%' border='0' cellspacing='0' cellpadding='5'>
              <%
Dim ipagecount 
Dim ipagecurrent 
Dim strorderBy 
Dim irecordsshown   
if request.querystring("page")="" then 
ipagecurrent=1 
else 
ipagecurrent=cint(request.querystring("page")) 
end if 
 %>
     <%
sql = "SELECT smallimg,viewpoint,name,time,txtcontent,id FROM produce where name like '%"&trim(key)&"%' ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset") 
rs.pagesize = 6 
rs.cachesize = 6 
rs.open sql,conn,1,1 
ipagecount = rs.pagecount 
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount 
If ipagecurrent < 1 Then ipagecurrent = 1 
if ipagecount=0 then %>
              <tr> 
                <td align='center'>找不到您要的产品<a><font color=red><%=trim(key)%></font></a></td>
              </tr>
              <% else %>
<tr><td>以下是您输入<a><font color=red><%=trim(key)%></font></a>这个关键字搜索出来的产品!</td>
              </tr>
<%
rs.absolutepage = ipagecurrent 
irecordsshown = 0 
do while irecordsshown<6 and NOT rs.EOF %>
              <tr align='left'> 
                <td width='33%' height="145"> 
                  <%
if not rs.eof then %>
                  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="40%"> 
                        <table width="130" border=0 align=center cellpadding=5 cellspacing=0 bgcolor='#e9e9e9'>
                          <tbody>
                          
                            <td width="182"><a href='display.asp?id=<%=rs("id")%>' target="_blank"><img src='admin/<%=rs("smallimg")%>' border='0' width=220></a></td>
                        </table>
                      </td>
                      <td width="1" rowspan="2" background="images/line1.gif"><img src="images/line1.gif"></td>
                      <td width="60%" rowspan="2" valign="top"> 
                        <table width="100%" border="0" cellspacing="8" cellpadding="0">
                          <tr>
                            <td>· 名称:<a href='display.asp?id=<%=rs("id")%>'><%=rs("name")%></a></td>
                          </tr>
                          <tr>
                            <td>· 介绍:<%=rs("txtcontent")%></td>
                          </tr>
                          <tr>
                            <td>· 添加时间:<%=rs("time")%></td>
                          </tr>
                        </table>
                        <br>
                        <br>
                        <br>
                      </td>
                    </tr>
                    <tr> 
                      <td height="14"></td>
                    </tr>
                    <tr> 
                      <td height="1" colspan="3" background="images/line.gif"></td>
                    </tr>
                  </table>
                  <img src="images/line1.gif" width="1" height="6"></td>
                <% 
irecordsshown = irecordsshown +1 
rs.movenext  
end if 
%>
              </tr>
              <%
loop 
end if 
rs.Close 
set rs=nothing %>

            </table>
            <div align="right">
              <table width='100%' border='0' cellspacing='0' cellpadding='5' >
                <tr> 
                  <td height='28'>
<div align="center">每页显示6个文件 共有 <%=ipagecount%> 页 当前为第 <%=ipagecurrent%>页 
                      <%
if ipagecurrent=1 then 
Response.Write"首页 | " 
else 
Response.Write"<a href='search.asp?key="&key&"&page=1'>首页</a> | " 
end if 
if ipagecurrent=1 then 
Response.Write"上一页 | " 
else 
Response.Write"<a href='search.asp?key="&key&"&page="&ipagecurrent-1&"'>上一页</a> | " 
end if 
if ipagecount>ipagecurrent then 
Response.Write"<a href='search.asp?key="&key&"&page="&ipagecurrent+1&"'>下一页</a> " 
else 
Response.Write"下一页"  
end if 
if ipagecount>ipagecurrent then 
Response.Write"| <a href='search.asp?key="&key&"&page="&ipagecount&"'>末页</a> " 
else 
Response.Write"| 末页 " 
end if %>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body><!--//#include file="foot.asp"-->
</html>

⌨️ 快捷键说明

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