?? osearch.asp
字號:
<%
key=request("key")
otype=request("otype")
searid=request("searid")
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>雷馳新聞發(fā)布管理系統(tǒng)</title>
</head>
<body topmargin="0">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td width="170" height="300" valign="top" bgcolor="efefef">
</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" and Search(searid) 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
response.end
end if
rs.open sql,conn,1,1
Function Search(SID)
dim SearchName,fs,thisfile
If key = 0 then
SearchName=server.mappath("wsearch.asp")
set fs=CreateObject("Scripting.FileSystemObject")
set thisfile=fs.opentextfile(SearchName,8,-2)
thisfile.Writeline(""&SID&"")
thisfile.close
set fs=Nothing
response.write " 查找字符串為空!"
End If
End Function
if rs.eof and rs.bof then
response.write "<p align='center'>對不起,沒有找到相關(guān)新聞</p>"
else
%>
<tr bgcolor="#9999CC">
<td width="9%" height="25" align="center" bgcolor="#0066CC">ID</td>
<td width="55%" align="center" bgcolor="#0066CC">新聞標(biāo)題</td>
<td width="15%" align="center" bgcolor="#0066CC">發(fā)布者</td>
<td width="21%" align="center" bgcolor="#0066CC">發(fā)布日期</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">關(guān)鍵字<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>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -