?? news_search.asp
字號:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Skin_css.asp"-->
<!--#include file="Inc/config.asp" -->
<%
key=Trim(request("key"))
otype=Trim(request("otype"))
BigClass=request("BigClass")
if key="" then
response.write "<script>alert('查找字符串不能為空!');history.back();</Script>"
response.end
end if
%>
<!-- #include file="Head.asp" --><body topmargin="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5" valign="top" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td height="72" valign="top" bgcolor="#FFFFFF"><table width="746" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="tdbg_left" width="190" height="179" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="get" action="News_search.asp">
<tr>
<td height="34" class="title_left"> <img src="Images/smallbook.jpg" width="10" height="10"> <font color="#000000">新
聞 搜 索</font></td>
</tr>
<tr>
<td height="21"><input type="text" name="key" size="19" class="input"></td>
</tr>
<tr>
<td height="21"><select name="otype" class="input">
<option value="title" selected class="input">新聞標題</option>
<option value="msg" class="input">新聞內容</option>
</select> <input type="submit" name="Submit" value="搜索" class="input"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="title_left" height="36" align="center"><div align="left"><a href="NewsType.asp?BigClass=<%=BigClass%>"><font color="#000000">
<%=BigClass%></font></a></div></td>
</tr>
<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass_New Where BigClassName='" & BigClass & "'",conn,1,1
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>
<tr onMouseOver="this.bgColor='#FFFFFF';" onMouseOut="this.bgColor='#EFEFEF';" bgColor=#EFEFEF>
<td height="28" ><div align="left"><a href="NewsType.asp?BigClass=<%=BigClass%>&SmallClass=<%=rsSmallClass("SmallClassName")%>"> <%=rsSmallClass("SmallClassName")%></a></div></td>
</tr>
<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing
%>
</table></td>
<td width="6"></td>
<td valign="top"><table Class=border width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="206" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="title_right" height="32"> <img src="Images/smallbook.jpg" width="10" height="10"> 新
聞 搜 索</td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<%
Set rs= Server.CreateObject("ADODB.Recordset")
if otype="title" then
sql="select * from news where title Like '%"&key&"%' order by id desc"
else
sql="select * from news where content Like '%"&key&"%' order by id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>對不起,沒有找到相關新聞</p>"
else
%>
<tr bgcolor="#86C2FF">
<td width="9%" height="25" align="center">ID</td>
<td width="55%" align="center" bgcolor="#86C2FF">新聞標題</td>
<td width="15%" align="center">發布者</td>
<td width="21%" align="center">發布日期</td>
</tr>
<%
i=0
do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td height="22" align="center"><%=rs("id")%></td>
<td> <a href="shownews.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
<td align="center"><%=left(rs("user"),5)%></td>
<td align="center"><%=rs("AddDate")%></td>
</tr>
<%
rs.movenext
i=i+1
loop
%>
<tr bgcolor="#FFFFFF">
<td height="24" colspan="4"> <div align="center">關鍵字<font color="#FF0000"><strong><%=key%></strong></font>,共為您找到<font color="#FF0000"><%=i%></font>條新聞</div></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="inc/foot.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -