📄 news_search.asp
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Skin_css.asp"-->
<!--#include file="Inc/config.asp" -->
<%
key=request("key")
otype=request("otype")
if key="" then
response.write "<script>alert('查找字符串不能为空!');history.back();</Script>"
response.end
end if
%>
<!-- #include file="Head.asp" --><body topmargin="0">
<table width="846" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td class="tdbg_left" width="217" valign="top">
<!--#include file="user.asp" -->
<!--#include file="Left_newsso.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</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"
elseif otype="msg" then
sql="select * from NEWS where content Like '%"& key &"%' order by id desc"
else
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>对不起,没有找到相关新闻</p>"
else
%>
<tr bgcolor="#CCCCCC">
<td width="9%" height="25" align="center">ID</td>
<td width="55%" align="center">新闻标题</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("infotime")%></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>
<!--#include file="inc/foot.asp"-->
</BODY>
</HTML>
<!--网站系统交易网:www.csys.com.cn-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -