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

📄 search.asp

📁 本程序采用花香内核
💻 ASP
字号:
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.asp"-->
<% 
if request("keyword")<>"" then
hx_search="ゴ|ガ|ギ|グ|ゲ|ザ|ジ|ズ|ヅ|デ|ド|ポ|ベ|プ|ビ|パ|ヴ|ボ|ペ|ブ|ピ|バ|ヂ|ダ|ゾ|ゼ"
hx_info=split(hx_search,"|")
If Request.Form<>"" Then
For Each hx_post In Request.Form
For hx_get=0 To Ubound(hx_info)
If Instr(LCase(Request.Form(hx_post)),hx_info(hx_get))<>0 Then
Response.Write "<Script>alert('对不起,您提交的内容中包含系统禁止字符!');window.close();</Script>"
Response.End
End If
Next
Next
End If
if instr(request("keyword"),"'")>0 then
Response.Write "<script language=javascript>alert('非法搜索参数');javascript:history.back();</script>"
end if
end if
Dim keyWord,SearchType
keyWord=Trim(Request("keyWord"))
SearchType=Trim(Request("SearchType"))
call head()
call menu()
select case request("SearchType")
case"新闻"
sql="select * from news where news_title like '%"&request("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 '%"&request("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 '%"&request("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 '%"&request("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 '%"&request("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 '%"&request("keyword")&"%'order by js_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
case"影视"
sql="select * from vid where title like '%"&request("keyword")&"%'order by vid_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
end select
%>
<table width="760"  border="0" cellspacing="0" cellpadding="0" class="table-shangxia" align=center>
   <tr>
    <td height="23"  class="a1">&nbsp;&nbsp;您输入的关键字为<font color='#FF0000'><%=request("keyword")%></font>,相关的<font color='#FF0000'><%=SearchType%></font>信息如下:</td>
   </tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align=center width=760 bgcolor=#ffffff class="table-hx66s"><tr>
<td align=left width=169>&nbsp;</td>
<td valign="top" width="22">&nbsp;</td>
<td valign=top width=552> 
<table cellspacing="0" cellpadding="0" border=0 bgcolor=#ffffff width=99% align=center class="table-zuoshang"> 
<%
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
		If IsNumeric(trim(Request("Page"))) = False Then
			GoError "分页参数错误,请不要试图破坏此系统。"
		End If
		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 class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'"><td height=25 width=65% class="table-xiayou">
&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 class="table-xiayou"><%=rs("news_count")%></td><td width=25% class="table-xiayou">
&nbsp;<%=rs("news_date")%></td></TR>
<%elseif request("SearchType")="音乐" then%>
<TR  height=25 class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'">
<TD width="65%" class="table-xiayou">
&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 class="table-xiayou"><%=rs("dj_count")%></TD>
<TD width="25%" align=Center class="table-xiayou"><%=rs("dj_date")%></TD></TR>
<%elseif request("SearchType")="文章" then%>
<tr class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'"><td height=25 width=65% class="table-xiayou">
&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% class="table-xiayou"><%=rs("art_count")%></td><td width=25% class="table-xiayou">&nbsp;<%=rs("art_date")%></td></tr>
<%elseif request("SearchType")="资源" then%>
<TR  height=25 class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'">
<TD width="65%" class="table-xiayou">
&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 class="table-xiayou"><%=rs("soft_dcount")%></TD>
<TD width="25%" align=Center class="table-xiayou"><%=rs("soft_joindate")%></TD></TR>
<%elseif request("SearchType")="图片" then%>
<tr class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'"><td height=25 width=65% class="table-xiayou">
&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% class="table-xiayou"><%=rs("pic_count")%></td><td width=25% class="table-xiayou">&nbsp;<%=rs("pic_date")%></td></tr>
<%elseif request("SearchType")="特效" then%>
<tr class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'"><td height=25 width=65% class="table-xiayou">
&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% class="table-xiayou"><%=rs("js_count")%></td><td width=25% class="table-xiayou">&nbsp;<%=rs("js_date")%></td></tr>
<%elseif request("SearchType")="影视" then%>
<tr class="tr" onmouseover="this.className='trover'" onmouseout="this.className='tr'"><td height=25 width=65% class="table-xiayou">
&nbsp;<img src=img/a3.gif border=0>&nbsp;<a href='showvid.asp?vid_id=<%=rs("vid_id")%>' Title='影片名称:<%=rs("title")%>&#13&#10查看次数:<%=rs("hits")%>&#13&#10上传时间:<%=rs("dateandtime")%>'><%=rs("title")%></a></td><td align=center width=10% class="table-xiayou"><%=rs("hits")%></td><td width=25% class="table-xiayou">&nbsp;<%=rs("dateandtime")%></td></tr>
<%
			End if
		Rs.MoveNext
		i=i+1
		Loop
%>
<tr><td align=middle height="60" colSpan=4 class="table-xiayou">
<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 class="table-xiayou">
<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>
<%
rs.close
set rs=nothing
call footer()%>

⌨️ 快捷键说明

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