📄 search.asp
字号:
<!--#include file="session.asp"-->
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel=STYLESHEET type=text/css>
<title>新闻搜索</title></head>
<body leftmargin="0" topmargin="0">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="mainmiddle">
<tr>
<td width="29" height="32"> <div align="left">
<p class="maindaohang"> </p>
</div></td>
<td width="709"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
</table>
<b><font color="#000000"><b> <span class="bigNavi">新闻搜索</span> </b></font></b></td>
<td width="8" class="mainrights"></td>
</tr>
</table>
<br>
<table width="65%" height="26" border="0" align="center" cellpadding="3" cellspacing="1" class="tabbgcolor">
<form action="search.asp" method="post" name="form1"><tr class="tabbgcolorli">
<td width="25%" height="24"> <div align="center">新闻关键词</div></td>
<td width="56%"> <div align="center"></div>
<div align="center"></div>
<div align="center"><input type="text" name="word" size="20" class="border"></div></td>
<td width="19%"> <div align="center"></div>
<div align="center"><input type="submit" name="sub1" class="border" value="查找"></div></td>
</tr>
</form>
</table>
<%
word1=request("word")
if word1="" then
response.end
else
%>
<br>
<table width="87%" height="22" border="0" align="center" cellpadding="3" cellspacing="1" class="tabbgcolor">
<tr class="tabbgcolorli">
<td width="25%"><div align="center">新闻标题</div></td>
<td width="31%"><div align="center">加入时间</div></td>
<td width="8%"><div align="center">操作</div></td>
<td width="6%"><div align="center">操作</div></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from news where title like '%"&word1&"%' order by id desc"
rs.open sql,conn,3,3
if rs.eof then
response.write "暂且没有您搜索的新闻"
response.end
else
do while not rs.eof
%>
<tr class="tabbgcolorli">
<td width="25%"><div align="center"><a href="../news/<%=rs("filename")%>.htm" target="_blank"><%=rs("title")%></a></div></td>
<td width="31%"><div align="center"><%=rs("date")%></div></td>
<td width="8%"><div align="center"><a href="modifying.asp?id=<%=rs("id")%>">修改</a></div></td>
<td width="6%"><div align="center"><a href="deling.asp?id=<%=rs("id")%>">删除</a></div></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing%>
</table>
<%end if%>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -