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

📄 news_search.asp

📁 漂亮的公司企业通用整站源码 希望大家能用的上
💻 ASP
字号:
<!--#include file="Inc/syscode.asp" -->
<!--#include file="head.asp" -->
<%
key=request("key")
otype=request("otype")
if key="" then
   response.write "<script>alert('查找字符串不能为空!');history.back();</Script>"
   response.end
end if
%>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top"><table width="850" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="30" valign="top" background="img/cont_left_bg01.gif"><img src="img/cont_left_img01.gif" width="30" height="431"></td>
        <td style="padding-top:9px; " width="787" valign="top"><table width="787" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="207" align="left" valign="top" class="top_m_txt01"><table width="200" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top"><table width="200" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="img/xwss.gif" width="200" height="67"></td>
                  </tr>
                  <tr>
                    <td align="center" valign="top" background="img/left_bg01.gif"><table width="89%" border="0" cellpadding="0" cellspacing="0">
                      <form name="form1" method="get" action="News_search.asp">
                        <tr>
                          <td  height="30" align="center" bgcolor="#F4F4F4"><input type="text" name="key" size="19" class="input"></td>
                        </tr>
                        <tr>
                          <td height="30" align="center" bgcolor="#F4F4F4"><select name="otype" class="input">
                              <option value="title" selected class="input">新闻标题</option>
                              <option value="msg" class="input">新闻内容</option>
                            </select>
                              <input type="submit" name="Submit2" value="搜索" class="input"></td>
                        </tr>
                      </form>
                    </table></td>
                  </tr>
                  <tr>
                    <td><img src="img/left_img01.gif" width="200" height="20"></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><table width="200" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="63" valign="bottom"><img src="img/rmxw.gif" width="200" height="51"></td>
                  </tr>
                  <tr>
                    <td style="padding-top:10px; " height="182" align="center" valign="top" background="img/left_bg02.gif"><table width="94%" border="0" cellpadding="0" cellspacing="0">
                      <%
t=0
Set rs=Server.CreateObject("ADODB.RecordSet") 
sql="SELECT * from NEWS order by id desc" 
rs.Open sql,conn,1,1
if not Rs.eof then
do while not rs.eof
t=t+1
%>
                      <tr>
                        <td width="17%" height="22" align="center" class="top_m_txt01"><%= t %></td>
                        <td width="82%"><a href="shownews.asp?id=<%=rs("id")%>" title="<%=rs("title")%>" target="_blank" class="top_m_txt01"><%=left(rs("title"),11)%></a></td>
                      </tr>
                      <% 
if t>=10 then exit do 
rs.movenext 
loop 
else 
response.write "<tr><td align=center colspan=2 bgcolor=#E8E8F4>尚无收录</td></tr>" 
end if 
rs.close 
%>
                    </table></td>
                  </tr>
                  <tr>
                    <td><img src="img/left_img02.gif" width="200" height="8"></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td valign="top"><table width="188" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="70" align="left" valign="bottom"><a href="Contact.asp"><img src="img/xsrx_img.gif" width="185" height="51" border="0"></a></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
            <td valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="img/cont_img01.gif" width="580" height="17"></td>
              </tr>
              <tr>
                <td valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="9" background="img/cont_tbl01_bg01.gif"></td>
                    <td align="center" valign="top"><table width="540" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="45" align="left" valign="top"><img src="img/xwzx.gif" width="298" height="36"></td>
                        </tr>
                      <tr>
                        <td valign="top"><table width="540" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td colspan="3"><img src="img/gsjs_img01.gif" width="540" height="19"></td>
                            </tr>
                          <tr>
                            <td width="22" valign="top" background="img/gsjs_left_bg01.gif"><img src="img/gsjs_img03.gif" width="22" height="149"></td>
                            <td width="498" rowspan="2" align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" class="top_m_txt01">
                              <% 
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="#FF9900">
                                <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" class="top_m_txt01"><%=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>
                            <td width="20" background="img/gsjs_right_bg01.gif"></td>
                          </tr>
                          <tr>
                            <td background="img/gsjs_bg01.gif"></td>
                            <td valign="bottom" background="img/gsjs_right_bg01.gif"><img src="img/gsjs_img04.gif" width="20" height="148"></td>
                          </tr>
                          <tr>
                            <td colspan="3"><img src="img/gsjs_img02.gif" width="540" height="18"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table></td>
                    <td width="9" background="img/cont_tbl01_bg01.gif"></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><img src="img/cont_img02.gif" width="580" height="17"></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="33" valign="top" background="img/cont_right_bg01.gif"><img src="img/cont_right_img01.gif" width="33" height="431"></td>
      </tr>
      <tr>
        <td valign="top"><img src="img/cont_di_img01.gif" width="30" height="29"></td>
        <td align="center" valign="middle" background="img/cont_di_bg01.gif" style="padding-top:9px; "><table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td width="39%"><table width="304" border="0" cellspacing="0" cellpadding="0">                <tr>                  <td width="57"><img src="img/yqlj_img01.gif" width="57" height="15"></td>                  <td width="247"><MARQUEE            align="left" width=230 scrollAmount=1 scrollDelay=4 class="top_m_txt01" onmouseover="this.stop()" onmouseout="this.start()">                    <% call ShowAnnounce(5) %>                  </MARQUEE></td>                </tr>            </table></td>            <td width="61%" align="right" class="top_m_txt01"><script language="JavaScript" type="text/javascript" src="inc/site.asp?online=1&show=all"></script></td>          </tr>        </table></td>
        <td valign="top"><img src="img/cont_di_img02.gif" width="33" height="29"></td>
      </tr>
    </table></td>
  </tr>
</table>
<!--#include file="Inc/foot.asp"-->

⌨️ 快捷键说明

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