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

📄 search.asp

📁 功能说明: 1
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
key=request("key")
otype=request("otype")
if key="" then
   response.write "<script>alert('查找字符串不能为空!');history.back();</Script>"
   response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<title>漳州网讯-新闻发布管理系统</title>
</head>
<body topmargin="0"><!--#include file="top.asp"-->
<table align="center"  border="0" width="782" cellspacing="0" cellpadding="0" height="208" background="images/bg.gif">
	<tr>
		<td valign="top" align="center">
<table width="759" border="0"cellpadding="0" cellspacing="0" bgcolor="#000000">
  <tr> 
    <td width="170" height="300" valign="top" bgcolor="efefef"> 
      <!--#include file="left.asp"-->
    </td>
    <td width="600" align="center" valign="top" bgcolor="#FFFFFF">
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td> </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td> </td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" 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="#9999CC"> 
          <td width="9%" height="25" align="center" bgcolor="#0066CC">ID</td>
          <td width="55%" align="center" bgcolor="#0066CC">新闻标题</td>
          <td width="15%" align="center" bgcolor="#0066CC">发布者</td>
          <td width="21%" align="center" bgcolor="#0066CC">发布日期</td>
        </tr>
        <%
i=0
do while not rs.eof
%>
        <tr bgcolor="#FFFFFF"> 
          <td height="22" align="center"><%=rs("id")%></td>
          <td> <a href="ONEWS.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="bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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