📄 searchnews.asp
字号:
<!--#include file="conn.asp"-->
<%
Dim i
Dim newsid
Dim title
Dim text
Dim starttime
Dim endtime
Dim postusername
newsid="%"&request("newsid")&"%"
title="%"&request("title")&"%"
text="%"&request("text")&"%"
if request("starttime")="" then
starttime="1970-1-1"
else
starttime=request("starttime")
end if
if request("endtime")="" then
endtime="2050-1-1"
else
endtime=request("endtime")
end if
postusername="%"&request("postusername")&"%"
%>
<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>在线考试系统</title>
<link rel="stylesheet" type="text/css" href="../DEFAULT.CSS">
<script language="JavaScript1.2" src="../js/lock.js"></script>
</head>
<body oncontextmenu="self.event.returnValue=false" onselectstart="selectstart();" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#007CD0" width="100%" id="AutoNumber1" height="25">
<tr>
<td width="100%">当前位置:新闻管理 > <font color="#FF0000">查询新闻</font></td>
</tr>
</table>
<hr noshade color="#FFFFFF" size="1"><% if request("btnSearch")<>"" then %>
<% sql="select * from exam_news where newsid like '"&newsid&"' and title like '"&title&"' and text like '"&text&"' and postusername like '"&postusername&"' and posttime between '"&starttime&"' and '"&endtime&"'"
rs.open sql,conn,3,2
if rs.eof then %>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="100%" class="noborder" bgcolor="#F1F1F1">
<tr>
<td width="100%" class="border">
<p align="center">没有符合条件的新闻!</td>
</tr>
</table>
<% else %>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#007CD0" width="100%" id="AutoNumber4" bgcolor="#F1F1F1">
<tr>
<td height="20" class="border_blue" colspan="4"> 新闻搜索结果</td>
</tr>
<tr>
<td height="20" colspan="4"> 共搜索到 <%=rs.recordcount%> 条记录 </td>
</tr>
<tr>
<td height="20" class="border" align="center" width="40">序号</td>
<td class="border" align="center">新闻标题</td>
<td class="border" align="center" width="120">发布人</td>
<td class="border" align="center" width="120">发布时间</td>
</tr>
<% i=1
do while not rs.eof %>
<tr>
<td height="20" align="center"><%=i%> </td>
<td><a href="viewnews.asp?newsid=<%=rs("newsid")%>"><%=rs("title")%></a> </td>
<td align="center"><%=rs("postusername")%> </td>
<td align="center"><%=rs("posttime")%> </td>
</tr>
<% rs.movenext
i=i+1
loop
end if %>
</table>
<% end if %>
<form method="POST" action="searchnews.asp">
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="480" id="AutoNumber3" class="withborder" bgcolor="#F1F1F1">
<tr>
<td height="25" class="border" colspan="2"> 查询新闻</td>
</tr>
<tr>
<td height="20" colspan="2"> 请输入关键字,可以用%代表任意字符</td>
</tr>
<tr>
<td width="100" height="20" align="right">新闻标题:</td>
<td> <input type="text" name="title" size="43" class="s01"></td>
</tr>
<tr>
<td height="20" align="right" width="100">新闻正文:</td>
<td> <input type="text" name="text" size="43" class="s01"></td>
</tr>
<tr>
<td height="20" align="right" width="100">发布时间:</td>
<td> <input name="starttime" readOnly class="s01" style="TEXT-ALIGN: center" size="16"><input onclick="popFrame.fPopCalendar(starttime,starttime,popCal);return false" class="c02" value="▼" size="2" name="1" readonly>
—
<input name="endtime" readOnly class="s01" style="TEXT-ALIGN: center" size="16"><input onclick="popFrame.fPopCalendar(endtime,endtime,popCal);return false" class="c02" value="▼" size="2" name="1" readonly></td>
</tr>
<tr>
<td height="20" align="right" width="100">发布人:</td>
<td> <input type="text" name="postusername" size="43" class="s01"></td>
</tr>
<tr>
<td colspan="2" height="30" class="border" style="height: 30">
<p align="center">
<input type="submit" value="搜 索" name="btnSearch" class="s02">
<input type="reset" value="重 置" name="B2" class="s02"></td>
</tr>
</table>
</center>
</div>
</form>
<!-- put these lines below ahead of you page --->
<div id="popCal" style="POSITION: absolute; VISIBILITY: hidden; WIDTH: 10px">
<iframe frameBorder="0" height="160" name="popFrame" scrolling="no" width="282" src="POPCJS.ASP">
</iframe>
</div>
<script event="onclick()" for="document">popCal.style.visibility = "hidden";
</script>
<!-- put these lines above ahead of you page --->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -