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

📄 search.asp

📁 电子书下载系统 后台管理:admin/index.asp 超级用户:admin 密码:admin 请在db/usre.asp,admin/usres更新数据库地址,防止他人下载。 建议把.
💻 ASP
字号:
<%
set rs_type=server.CreateObject("ADODB.RecordSet")
set rs=server.CreateObject("ADODB.RecordSet")
Function CheckStr(Str)
        If Trim(Str)="" Or IsNull(str) Then Exit Function
        Checkstr=Replace(Trim(Str),"'","''")
        Checkstr=Replace(Trim(Str),"%","''")
End Function
sss=request("sss")
if CheckStr(request("cd"))="" and CheckStr(request("k"))="" then
  MaxPerPage=30 '###每页显示条数
  sePAGE="no"
else
  MaxPerPage=10 '###每页显示条数
end if
if CheckStr(request("pl"))<>"" then
  pl=CheckStr(request("pl"))
else
pl="time"
end if
skN=CheckStr(request("k"))
skP="更新日期"
if CheckStr(request("pl"))="downcount" then
  skP="下载次数"
elseif CheckStr(request("pl"))="count" then
  skP="人气浏览"
end if 
if CheckStr(request("cd"))<>"" then
    skN=CheckStr(request("cd"))
    skCD=" and cd='"&request("cd")&"'"
  end if
%>
<!--#include file="db/user.asp" -->
<!--#include file="head.asp"-->
<div align=center> </div>
<div align=center> 
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="737">
    <tr> 
      <td width="100%" bgcolor="#eeeeee" height="1" colspan="2"></td>
    </tr>
    <tr> 
      <td bgcolor="#f7f7f7" height="24">&nbsp;您的位置:<a href="./">首页</a>&nbsp;>>&nbsp;查找结果&nbsp;>>&nbsp;关键字:<font color="#FF0000"><%=skN%></font> 
        [<font color="#008000">尽量不要带版本号</font>]</td>
      <td bgcolor="#f7f7f7" height="24" align="right"></td>
    </tr>
    <tr> 
      <td width="100%" bgcolor="#eeeeee" height="1" colspan="2"></td>
    </tr>
    <tr> 
      <td width="100%" bgcolor="#FFFFFF" height="4" colspan="2"></td>
    </tr>
  </table>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="737" bgcolor="#FFFFFF" align="center">
  <tr> 
    <td width="2"><img border="0" src="images/c.gif" width="2" height="1"></td>
    <td width="188" valign="top" bgcolor="#F7F7F7">&nbsp; </td>
    <td width="4"><img border="0" src="images/c.gif" width="4" height="1"></td>
    <td width="572" valign="top"> 
      <table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#FFFFFF">
        <tr> 
          <td width="52%" bgcolor="#CCCCCC" height="24" align="center"><font color="#FFFFFF"><b>软件名称</b></font></td>
          <td width="12%" bgcolor="#CCCCCC" height="24" align="center"><a href="search.asp?cd=<%=request("cd")%>&amp;pl=time&amp;k=<%=request("k")%>" title="按更新时间重新排列软件"><font color="#FFFFFF"><b>更新时间</b></font></a></td>
          <td width="12%" bgcolor="#CCCCCC" height="24" align="center"><a href="search.asp?cd=<%=request("cd")%>&amp;pl=downcount&amp;k=<%=request("k")%>" title="按下载次数值重新排列软件"><font color="#FFFFFF"><b>下载次数</b></font></a><a href="search.asp?cd=<%=request("cd")%>&amp;pl=hot&amp;k=<%=request("k")%>" title="按软件等级重新排列软件"><font color="#FFFFFF"></font></a></td>
          <td width="12%" bgcolor="#CCCCCC" height="24" align="center"><a href="search.asp?cd=<%=request("cd")%>&pl=count&k=<%=request("k")%>" title="按软件等级重新排列软件"><font color="#FFFFFF"><b>人气指数</b></font></a><a href="search.asp?cd=<%=request("cd")%>&amp;pl=downcount&amp;k=<%=request("k")%>" title="按下载次数值重新排列软件"><font color="#FFFFFF"></font></a></td>
          <td width="12%" bgcolor="#CCCCCC" height="24" align="center"><font color="#FFFFFF"><b>文件大小</b></font></td>
        </tr>
        <%if request("k")="" and request("pl")="" and request("cd")="" then%>
        <tr> 
          <td width="100%" colspan="5" height="138" align="center" bgcolor="#FFFFFF">关键词不能为空!<a href="search.asp?cd=<%=request("cd")%>&amp;pl=downcount&amp;k=<%=request("k")%>" title="按下载次数值重新排列软件"><font color="#FFFFFF"><b>下载次数</b></font></a></td>
        </tr>
        <%else
    set rs_list=server.CreateObject("ADODB.RecordSet")
    set rs_type=server.CreateObject("ADODB.RecordSet")
    set rs=server.CreateObject("ADODB.RecordSet")
      KN=split(request("k")," ")
      for i = 0 to ubound(KN)
        KNN=KNN&" or name like '%"&KN(i)&"%' "

      next
    %>
        <%
sql="select * from download where (name like '%"&request("k")&"%'"&KNN&")"&skCD&" order by "&pl&" desc"
rs.open sql,conn,1,1
if rs.eof then
%>
        <tr> 
          <td width="100%" colspan="5" bgcolor="#FFFFFF" align="center" height="160"><img src="images/d_sorryNoSearch.gif" border="0" width="186" height="150"></td>
        </tr>
        <%else
if sePAGE<>"no" then '###排行方式时只显示指定数目
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount     '得到总页数
allshu=rs.recordcount
   if request("page")<>"" then
      if cint(request("page"))<1 or cint(request("page"))>mpage then
         currentPage=1
      else
         currentPage=cint(request("page"))
      end if
   else        
      currentPage=1        
   end if
rs.move  (currentPage-1)*MaxPerPage
end if '###排行方式时只显示指定数目
do while not rs.eof%>
        <%'''软件
       softname=rs("name")
       if request("k")<>"" then
          for i = 0 to ubound(KN)
          softname=replace(softname,""&KN(i)&"","<font color=#FF0000>"&KN(i)&"</font>")
          next
       end if%>
        <tr height="60"> 
          <td width="52%" bgcolor="#FFFFFF" height="24">·<a target=_blank href="show.asp?id=<%=rs("id")%>"><b><%=softname%></b></a>&nbsp; 
          </td>
          <td width="12%" align="center" bgcolor="#FFFFFF" height="24"><%=year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))%></td>
          <td width="12%" align="center" bgcolor="#FFFFFF" height="24"><%=rs("downcount")%> 
          </td>
          <td width="12%" align="center" bgcolor="#FFFFFF" height="24"><%=rs("count")%></td>
          <td width="12%" align="center" bgcolor="#FFFFFF" height="24"><%=rs("size")%></td>
        </tr>
        <tr height="60"> 
          <td width="100%" bgcolor="#FFFFFF" colspan="5" height="1">&nbsp;&nbsp;&nbsp; 
            <%if rs("show")<>"" then%>
            <%
tempstr=replace(rs("show"),"<br>","")
tempstr=replace(tempstr,"<p>","")
tempstr=replace(tempstr,"<b>","")
tempstr=replace(tempstr,"<","")
tempstr=replace(tempstr,"&nbsp;","")
tempstr=replace(tempstr," ","")
tempstr=replace(tempstr," ","")
show=left(tempstr,100)
       if request("k")<>"" and request("kt")<>"软件名称" and request("type")<>"cd" then
          for i = 0 to ubound(KN)
          show=replace(show,""&KN(i)&"","<font color=#FF0000>"&KN(i)&"</font>")
          next
       end if%>
            <%=show%>... 
            <%else%>
            很不错,自己看看吧! 
            <%end if%>
          </td>
        </tr>
        <tr height="60"> 
          <td width="100%" bgcolor="#FFFFFF" colspan="5" height="20">&nbsp;</td>
        </tr>
        <tr> 
          <td width="100%" colspan="5" height="1" background="images/bg_dot.gif" bgcolor="#FFFFFF"></td>
        </tr>
        <%
di=di+1
if di>=MaxPerPage then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
      </table>
      <%if allshu>0 and skPAGE<>"no" then%>
      <center>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr> 
            <td nowrap bgcolor="#F7F7F7">&nbsp;共找到<b><%=allshu%></b>条&nbsp;当前第<b><%=currentPage%></b>/<b><%=mpage%></b>页&nbsp;每页<b><%=MaxPerPage%></b>条</td>
            <td bgcolor="#F7F7F7"> 
              <%
pageno=currentPage
%>
              <%if cint(pageno)>1 then%>
              <a href="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>" title="最前页"> 
              <%end if%>
              首页</a>&nbsp; 
              <%if cint(pageno)>1 then%>
              <a href="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>&page=<%=pageno-1%>" title="上一页"> 
              <%end if%>
              上一页</a> 
              <%                                                                             
pp=cint(pageno)-5            
  if pp<1 then            
  pp=1            
  end if            
for pno=pp to mpage
if len(pno)=1 then
end if
p=p+1
if pno*1=cint(pageno)*1 then
%>
              &nbsp;<font color="#FF0000">[<%=pno%>]</font> 
              <%else%>
              &nbsp;<a href="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>&page=<%=pno%>">[<%=pno%>]</a> 
              <%end if%>
              <%                                                                         
if p>=7 then exit for            
next%>
              &nbsp; 
              <%if cint(pageno)< mpage then%>
              <a href="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>&page=<%=pageno+1%>" title="下一页"> 
              <%end if%>
              下一页</a>&nbsp; 
              <%if cint(pageno)< mpage then%>
              <a href="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>&page=<%=mpage%>" title="最后页"> 
              <%end if%>
              尾页</a> </td>
            <form method="POST" action="search.asp?cd=<%=request("cd")%>&pl=<%=request("pl")%>&k=<%=request("k")%>">
              <td align="right" bgcolor="#F7F7F7">转到第 
                <input class=textbox name="page" size="3">
                页&nbsp; 
                <input align="absmiddle" height="21" name="Submit2" src="images/d_goto.gif" type="image" value="Submit" width="27">
                &nbsp;</td>
            </form>
          </tr>
          <tr> 
            <td width="100%" colspan="5" height="1" background="images/bg_dot.gif" bgcolor="#FFFFFF"></td>
          </tr>
        </table>
        <% end if%>
      </center>
</table>
<!--#include file="myads.asp" --></BODY></HTML>

⌨️ 快捷键说明

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