📄 search.asp
字号:
<!--#include file="conn.asp"-->
<%
id = Request("id")
if not isnumeric(Request("id")) then id = 1
set rs = Server.CreateObject("adodb.recordset")
if Request("Search")="按文档名搜索" then
rs.open "select id,title,title_1,name from title where tshow=true and title like '%"&HTMLEncode(request("text"))&"%' order by id desc ",conn,1,3
Elseif Request("Search")="按作者名搜索" then
rs.open "select id,title,title_2,name from title where tshow=true and name like '%"&HTMLEncode(request("text"))&"%' order by id desc ",conn,1,3
Elseif Request("Search")="按文档内容搜索" then
rs.open "select id,title,title_2,name from title where tshow=true and text like '%"&HTMLEncode(request("text"))&"%' order by id desc ",conn,1,3
End if
if rs.eof then
Response.Write "未找到你所需的信息! <a href=index.asp>返回</a> "
Response.End
End if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>搜索:<%=HTMLEncode(request("text"))%>-<%=title_name%></title>
<style>
<!--
body, table, tr, td, p, a, html, select, option, input { font-family: 宋体; font-size: 9pt; text-decoration: none; color: #000000; line-height:150% }
A:hover { FONT-SIZE: 9pt; COLOR: #FF0000; FONT-FAMILY: 宋体; TEXT-DECORATION: none }
A.mecl { FONT-SIZE: 9pt; COLOR: #FFFFFF; FONT-FAMILY: 宋体; TEXT-DECORATION: none }
a:visited.mecl { FONT-SIZE: 9pt; COLOR: #FFFFFF; FONT-FAMILY: 宋体; TOP: 1px; TEXT-DECORATION: none }
a:hover.mecl { FONT-SIZE: 9pt; COLOR: #FFFF00; FONT-FAMILY: 宋体; POSITION: relative; TOP: 1px; TEXT-DECORATION: none }
-->
</style>
<Script Language="JavaScript">
function AddFav()
{
window.external.addFavorite(window.document.location.href,document.title);
}
</Script>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#CCCCCC">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="778" bgcolor="#FFFFFF">
<tr>
<td width="100%" height="70">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="100%">
<tr>
<td width="200">
<p align="center">
<img border="0" src="img/logo_3.gif" width="179" height="58"></td>
<td>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" height="60">
<tr>
<td width="100%">
<p align="center">广告位</td>
</tr>
</table>
</center>
</div>
</td>
<td width="120">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="70%" align="center" height="20">
<a onclick="javascript:this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.9y.com.cn')" href="JavaScript:">
<font size="1" color="#808080">●</font>
设为首页</a>
</td>
</tr>
<tr>
<td width="70%" align="center" height="20">
<a href="JavaScript:AddFav()">
<font size="1" color="#808080">●</font>
加入收藏</a>
</td>
</tr>
<tr>
<td width="70%" align="center" height="20">
<a href="mailto:administrator@9y.com.cn">
<font size="1" color="#808080">●</font>
联系我们</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" background="img/bj_3.gif" height="29" align="right" style="padding-left: 10; padding-right: 10">
<font color="#FFFFFF">
<a href="index.asp" class="mecl">首页</a></a>
<%
set rs_title_1 = server.CreateObject ("adodb.recordset")
rs_title_1.open "select * from title_1",conn,1,3
if not rs_title_1.eof then
for title_i = 1 to rs_title_1.recordcount
%>
<FONT color="#ffffff">-</FONT>
<a href='class.asp?title_1=<%=rs_title_1("title_1")%>' class="mecl">
<%=rs_title_1("title_1")%></a>
<%
rs_title_1.movenext
if rs_title_1.eof then exit for
next
end if
rs_title_1.close
set rs_title_1 = nothing
%> </td>
</tr>
<tr>
<td width="100%" background="img/bj_5.gif" height="29" style="padding-left: 30; padding-right: 30">
<p align="right">
<%
if Request("title_1")<>"" then
set rs_title_2 = Server.CreateObject("adodb.recordset")
rs_title_2.open "select * from title_2 where title_1 = '"& Request("title_1") &"' ",conn,1,3
if not rs_title_2.Eof then
for title2_i = 1 to rs_title_2.recordcount
Response.Write "<a href='Class.asp?title_2="&rs_title_2("title_2")&"'>"&rs_title_2("title_2")&"</a> "
rs_title_2.movenext
if rs_title_2.Eof then exit for
next
End if
rs_title_2.close
set rs_title_2 = nothing
End if
%>
</td>
</tr>
<tr>
<td width="100%" style="padding-top: 5" height="17"> 当前位置:<a href="index.asp">首页</a> -> 文档列表</td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding: 5" bordercolor="#FFFFFF" width="100%">
<tr>
<td width="75%" valign="top" rowspan="4">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 1px solid #CCCCCC; padding: 5" bordercolor="#111111" width="100%" height="100%">
<tr>
<td width="100%" height="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<%
rs.pagesize=10
if not isnumeric(Request("Page")) then
Page=1
else
page = cint(request("page"))
End if
if page = "" then page = 1
if page < 1 then page=1
if page >= rs.pagecount then page = rs.pagecount
rs.absolutepage = page
for i=1 to rs.PageSize
%>
<tr>
<td width="100%" align="center" bgcolor="#F7F7F7">
<p align="left">
<%
Response.Write "<a href=article.asp?id="&rs("id")&"&title="&rs("title")&"><font size='1' color='#808080'>●</font> "&rs("title")&"</a><font color='#808080'>[作者:"&rs("name")&"]</font>"
rs.movenext
%></td>
</tr>
<%if not rs.eof then%>
<tr>
<td width="100%" align="center">
<p align="left">
<%
Response.Write "<a href=article.asp?id="&rs("id")&"&title="&rs("title")&"><font size='1' color='#808080'>●</font> "&rs("title")&"</a><font color='#808080'>[作者:"&rs("name")&"]</font>"
%>
</td>
</tr>
<%
rs.movenext
End if
if rs.eof then exit for
next
%>
<tr>
<td width="100%" align="center">
<hr noshade color="#C0C0C0" size="1"></td>
</tr>
<tr>
<td width="100%" align="center">
<p align="left">
<a href="?Search=<%=Request("Search")%>&text=<%=Request("text")%>&page=1">第一页</a>
<a href="?Search=<%=Request("Search")%>&text=<%=Request("text")%>&page=<%=page-1%>">上一页</a><%
if rs.pagecount<10 then
for x=1 to rs.pagecount
Response.Write(" <a href='"&request.servervariables("document_name")&"?Search="&Request("Search")&"&text="&Request("text")&"&page="&x&"'>"&Replace("["&x&"]","["&page&"]","<font color=#FF0000>"&page&"</font>")&"</a> ")
next
else
if page<10 then
for x=1 to 10
Response.Write(" <a href='"&request.servervariables("document_name")&"?Search="&Request("Search")&"&text="&Request("text")&"&page="&x&"'>"&Replace("["&x&"]","["&page&"]","<font color=#FF0000>"&page&"</font>")&"</a> ")
next
Else
if page+10>rs.pagecount then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -