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

📄 search.asp

📁 后台登陆admin.asp
💻 ASP
字号:
<!--#include file="mdb.asp"-->
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.asp"-->
<%
dim keyWord,SearchType
keyWord = checkspace(trim(request.QueryString("keyWord")))
SearchType = checkspace(trim(request.QueryString("SearchType")))
if keyWord="" then
Response.Write "<script>alert('搜索关键字不能为空');window.close();</script>"
Response.End
end if
If Len(keyWord)>8 Then
Response.Write "<script>alert('搜索关键字超出系统限定<8个字符范围');window.close();</script>"
Response.End
end if
if request("page")<>"" then
  if not isInteger(request("page")) then
    Response.Write "<script language=javascript>alert('分页参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
start="全站搜索"
call head()
call menu()
select case SearchType
case"云南"
sql="select * from news where news_title like '%"&Jencode(keyWord)&"%' order by news_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"音乐"
sql="select * from dj where passed=0 and dj_name like '%"&Jencode(keyWord)&"%' order by dj_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"线路"
sql="select * from art where passed=0 and art_title like '%"&Jencode(keyWord)&"%' order by art_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"文章"
sql="select * from web where passed=0 and art_title like '%"&Jencode(keyWord)&"%' order by art_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"资源"
sql="select * from soft where passed=0 and soft_name like '%"&Jencode(keyWord)&"%' order by soft_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"图片"
sql="select * from pic where passed=0 and pic_name like '%"&Jencode(keyWord)&"%' order by pic_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"特效"
sql="select * from js where js_name like '%"&Jencode(keyWord)&"%' order by js_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"笑话"
sql="select * from joke where passed=0 and art_title like '%"&Jencode(keyWord)&"%' order by art_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
end select
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="table-hx66s">
   <tr>
    <td height="23">&nbsp;&nbsp;你的位置:<a href='index.asp'><%=webname%></a> >> <%=start%></td>
   </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="table-hx66s">
  <tr>
    <TD width=175 vAlign=top align=center>
  <table border="0" width=165 align="center" cellpadding="0" cellspacing="1" class="b5" style="border-collapse: collapse">
   <tr>
    <td height="26" class="a5">&nbsp;&nbsp; 会 员 登 录</td>
   </tr>
   <tr>
    <td height="22"><%call userlogin()%></td>
   </tr>
      <tr>
    <td height="26" class="a5">&nbsp;&nbsp; 继 续 搜 索</td>
   </tr>
    <tr><form action="search.asp" method="get">
          <td align="center" height="20"><DIV style="padding-top:5px;padding-bottom:5px;"><select name="SearchType" class='input'>
<option value="云南">走进云南</option>
<option value="线路">旅游线路</option>
<option value="文章">旅游手记</option>
<option value="笑话">幽默笑话</option>
<option value="图片">精美图片</option>
<option value="音乐">歌曲音乐</option>
<option value="资源">下载中心</option>
<option value="特效">网页特效</option>
</select>&nbsp;<input style="{background-image: url(img/search_1.gif);height: 

18px; width: 60px;border: 0px;}" value="" type="submit"></DIV><DIV style="padding-

top:1px;padding-bottom:3px;"><input name="keyWord" type="text" class='input' 

size="22"></DIV></td>
      </form></tr>
   <tr>
    <td height="26" class="a6">&nbsp;&nbsp; 本 站 声 明</td>
   </tr>
   <tr>
    <td><div style="LINE-HEIGHT: 180%">&nbsp;<font color=#FF0000>·</font>本站的大部分资料,文章都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我们,我们将马上进行整理,谢谢。</td>
   </tr>
</table><BR>
</TD>
<td width="*" valign="top" align="right">
<table border="0" width="99%" align="center" cellpadding="0" cellspacing="1" class="b4" style="border-collapse: collapse">
   <tr>
    <td height="23"  class="a1">&nbsp;&nbsp;&nbsp;&nbsp;您输入的关键字为<font color='#FF0000'><%=request("keyword")%></font>,相关的 <font color='#FF0000'><%=SearchType%></font> 信息(<%=rs.recordcount%>条)如下:</td>
   </tr>
<tr>
<td valign="top">
<table width="100%" border="1" align="center" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" bordercolor="#f0f0f0" style="border-collapse: collapse">
<%
const MaxPerPage=20 '单独页最大记录数 const 用来申明常量
dim totalPut
dim CurrentPage
dim TotalPages
dim i
if not Rs.eof then
	Rs.MoveFirst
end if
Rs.pagesize=MaxPerPage
	If trim(Request("Page"))<>"" then
		CurrentPage= CLng(request("Page")) 
		If CurrentPage> Rs.PageCount then
			CurrentPage = Rs.PageCount 
		End If 
Else 
	CurrentPage= 1 
End If 
totalPut=Rs.recordcount
if CurrentPage<>1 then
	if (currentPage-1)*MaxPerPage<totalPut then
		Rs.move(currentPage-1)*MaxPerPage
		dim bookmark
		bookmark=Rs.bookmark
	end if 
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
	n= totalPut \ MaxPerPage
else  
	n= totalPut \ MaxPerPage + 1  
end if

	If Not Rs.Eof Then
i=0
Do While Not Rs.Eof and i<maxperpage
if request("SearchType")="云南" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href="shownews.asp?news_id=<%=rs("news_id")%>" Title="新闻名称:<%=rs("news_title")%>&#13&#10上传时间:<%=rs("news_date")%>&#13&#10浏览指数:<%=rs("news_count")%>" target=_blank><%=rs("news_title")%></a>
</TD><td width=10% align=center><%=rs("news_count")%></td><td width=25%>
&nbsp;<%=rs("news_date")%></td></TR>
<%elseif request("SearchType")="音乐" then%>
<TR>
<TD width="65%">
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a title="娱乐名称:<%=rs("dj_name")%>&#13&#10视听次数:<%=rs("dj_count")%>&#13&#10上传时间:<%=rs("dj_date")%>"  href='showdj.asp?dj_id=<%=rs("dj_id")%>'><%=rs("dj_name")%></a>
</td>
<td width="10%" align=Center><%=rs("dj_count")%></TD>
<TD width="25%" align=Center><%=rs("dj_date")%></TD></TR>
<%elseif request("SearchType")="线路" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a Title='线路名称:<%=rs("art_title")%>&#13&#10发表时间:<%=rs("art_date")%>&#13&#10阅读次数:<%=rs("art_count")%>次' href="showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>"
target=_blank><%=rs("art_title")%></a></td><td align=center width=10%><%=rs("art_count")%></td><td width=25%>&nbsp;<%=rs("art_date")%></td></tr>
<%elseif request("SearchType")="文章" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a Title='文章名称:<%=rs("art_title")%>&#13&#10发表时间:<%=rs("art_date")%>&#13&#10阅读次数:<%=rs("art_count")%>次' href="showweb.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>"
target=_blank><%=rs("art_title")%></a></td><td align=center width=10%><%=rs("art_count")%></td><td width=25%>&nbsp;<%=rs("art_date")%></td></tr>

<%elseif request("SearchType")="资源" then%>
<TR>
<TD width="65%">
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href="showdown.asp?soft_id=<%=rs("soft_id")%>" target="_blank" title="程序名称:<%=rs("soft_name")%>&#13&#10文件大小:<%=rs("soft_size")%>&#13&#10下载次数:<%=rs("soft_dcount")%>&#13&#10查看次数:<%=rs("soft_rcount")%>&#13&#10上传时间:<%=rs("soft_joindate")%>" ><%=rs("soft_name")%></a>
</td>
<td width="10%" align=Center><%=rs("soft_dcount")%></TD>
<TD width="25%" align=Center><%=rs("soft_joindate")%></TD></TR>
<%elseif request("SearchType")="图片" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a title="图片名称:<%=rs("pic_name")%>&#13&#10文件大小:<%=rs("pic_url")%>&#13&#10点击次数:<%=rs("pic_count")%>次&#13&#10上传时间:<%=rs("pic_date")%>" href="showpic.asp?pic_id=<%=rs("pic_id")%>"
target=_blank><%=rs("pic_name")%></a></td><td align=center width=10%><%=rs("pic_count")%></td><td width=25%>&nbsp;<%=rs("pic_date")%></td></tr>
<%elseif request("SearchType")="特效" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href='showjs.asp?js_id=<%=rs("js_id")%>' Title='特效名称:<%=rs("js_name")%>&#13&#10查看次数:<%=rs("js_count")%>&#13&#10上传时间:<%=rs("js_date")%>'><%=rs("js_name")%></a></td><td align=center width=10%><%=rs("js_count")%></td><td width=25%>&nbsp;<%=rs("js_date")%></td></tr>


<%elseif request("SearchType")="笑话" then%>
<tr><td height=25 width=65%>
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a Title='笑话标题:<%=rs("art_title")%>&#13&#10发表时间:<%=rs("art_date")%>&#13&#10阅读次数:<%=rs("art_count")%>次' href="showjoke.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>"
target=_blank><%=rs("art_title")%></a></td><td align=center width=10%><%=rs("art_count")%></td><td width=25%>&nbsp;<%=rs("art_date")%></td></tr>





<%else
Response.Write "<script>alert('非法操作,参数错误 !');window.close();</script>"
response.end
		End if
		Rs.MoveNext
		i=i+1
		Loop
%>
<tr><td align=middle height="60" colSpan=4>
<center><%
	Response.Write "您输入的关键字为<font color='#FF0000'>"&request("keyword")&"</font>,共<font color='#FF0000'>"&totalPut&"</font>条信息 <BR>" 
          k=currentPage
		if k<>1 then
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page=1'>首页</a></b>] "
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(k-1)&"'>上一页</a></b>] "
		else
			Response.Write "[首页] [上一页]"
		end if
		if k<>n then
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(k+1)&"'>下一页</a></b>] "
			response.write "[<b>"+"<a href='Search.asp?keyWord="&keyWord&"&SearchType="&SearchType&"&page="&cstr(n)&"'>尾页</a></b>] "
		else
			Response.Write "[下一页] [尾页]"
		end if	
		Response.Write " 页次:<font color='#ff0000'>"&currentpage&"</font>/"&n&"页 20条信息/页"
		%>
        转到:
        <select name="select" onchange="javascript:window.location='Search.asp?keyWord=<%=keyWord%>&SearchType=<%=SearchType%>&page='+this.options[this.selectedIndex].value;">
          <option>跳转</option>
          <%
Dim z
For z=1 To n%>
          <option value="<%=z%>">第<%=z%>页</option>
          <%
Next
%>
        </select>
         </div></td>
          </tr></table><BR>
<%Else%>
<tr><td align=middle height="60" colSpan=4>
<center><font color=red><b><%if request("keyword")<>"" then%>没有找到标题包含关键字[<b><font color=red><%=request("keyword")%></font></b>]的<%=SearchType%> !<%else%>没有任何<%=SearchType%>,请管理员到后台添加!<%end if%>
</b></font></center></td></td></tr>
</TD></TR></TABLE><BR>
<%End If
Rs.Close%>
</TD></TR></table><BR></TD></TR></table>
<%
set rs=nothing
call footer()%>

⌨️ 快捷键说明

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