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

📄 search.asp

📁 类似于baidu的百度知道
💻 ASP
字号:
<!--#include file=conn.asp-->
<!--#include file="Config.asp"-->
<%if request("content")="" then
	  response.write"<script>alert('搜索关键字不能为空!');history.back();</script>"
	  else%>
<title><%=webname%>搜索_<%=HTMLcode(request("content"))%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<!--#include file=top.asp-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="24"><a href="<%=weburl%>"><%=webname%></a> &gt; 搜索结果</td>         
  </tr>
</table>
<center>

<%
content=HTMLcode(request("content"))
rs.open"select * from question where title like '%"&content&"%' or content like '%"&content&"%'",conn,1,1
maxnum=rs.recordcount
if rs.eof then%>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr class="t11"> 
    <td height="24" colspan=2><div align="right">共搜到相关问题 0 项</div></td>  
  </tr>
<TR align="left" valign="middle">
    <TD height=37 colspan="2">

      <br><font color="#FF0000">★未找到和您的查询相匹配的“已解决问题”。</font>
      <form name="fasmid" action="TiWen.asp?content=<%=HTMLcode(request("content"))%>" method="get">您可以在此<a href="TiWen.asp?content=<%=HTMLcode(request("content"))%>">提问</a>,让其他网友帮您一起找答案!<input type="text" name="content" maxlength="256" size="30" value="<%=HTMLcode(request("content"))%>" class="ip22">&nbsp;&nbsp;<input type="submit" value="我要提问" class="ip2"></form>
		 您还可以:
<div style="padding-left:3px">
	     <LI> 查看输入的文字是否有误; </li>
        <LI>去掉可能不必要的字词,如"的"、"什么"等;</li>
        <LI>请看<a href="Help.asp">问吧帮助</a>;</LI>
		</div>	    
        <p>         
</P>
</TD>
  </TR>
</table>
<%else%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="t11">
  <tr> 
    <td height="24"><div align="right">共搜到相关问题 <%=maxnum%> 项</div></td>       
  </tr>
</table>
<div  id="mainDiv"> 
<div align="center">
<%
		rs.pagesize=10
		maxpage=rs.pagecount
		if request("p")="" then
		p=1
		else
		p=cint(request("p"))
		end if
		if p>maxpage then
		p=maxpage
		end if
		if p=0 then
		p=1
		end if
		if p<>1 then
		rs.move (p-1)*rs.pagesize
		end if
		for i=1 to rs.pagesize
		%>
<br>

 <table border="0" width="98%" id="table1" cellspacing="0" cellpadding="0">
	<tr class="t11">
		<td width="1%" height="24">
		<p align="right"> &nbsp;&nbsp; <%if rs("jie")=0 then %><img src=img/icn_time.gif  alt=待解决问题><%elseif rs("jie")=1 or rs("jie")=3 then%><img src=img/icn_ok.gif  alt =已解决问题><%elseif rs("jie")=2 then%><img src=img/icn_cancel.gif  alt =问题已关闭><%elseif rs("jie")=4 then%><img src=img/icn_vote.gif  alt =投票中问题><%end if%></td>
		<td height="24" height="99%">&nbsp;<a href="Show_Question.asp?id=<%=rs("id")%>" target=_blank><%=HTMLcode(rs("title"))%></a></td>
	</tr>
	<tr>
		<td colspan="2"><%=left(HTMLcode(rs("content")),150)&"..."%></td>
	</tr>
	<tr>
		<td colspan="2" height="24">
		<p align="right"><%if rs("niming")=1 then%>匿名<%else%><a href="Show_User.asp?name=<%=rs("sender")%>" target=_blank><%=rs("sender")%></a><%end if%> - <%=rs("sendtime")%>  -  <%if rs("jie")=1 then%>最佳回答者:<a href="Show_User.asp?name=<%=rs("sender")%>" target=_blank><%=rs("jieuser")%></a>      
 - <%end if%><a href="List_Little.asp?id=<%=rs("fenleiid")%>" ><%=rs("topic")%></a></font>
		</p>
</p>      
<%rs.movenext
		if rs.eof then exit for
		next%></td>
	</tr>
</table>
<br>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" class="t11">
  <tr> 
    <td class="bgpagLn" align="center">共<font color=red><%=maxnum%></font>个相关问题,10个每页,分<font color=red><%=maxpage%></font>页,当前页<font color=red><%=p%></font>
		<a href=Search.asp?submit=站内搜索&content=<%=content%>&p=1>首页</a> 
		<a href=Search.asp?submit=站内搜索&content=<%=content%>&p=<%=p-1%>>上页</a> 
		<a href=Search.asp?submit=站内搜索&content=<%=content%>&p=<%=p+1%>>下页</a> 
		<a href=Search.asp?submit=站内搜索&content=<%=content%>&p=<%=maxpage%>>尾页</a> 
</td> 
  </tr>
</table>
<br>
<%
end if
end if
rs.close
%><!--#include file=end.asp-->

⌨️ 快捷键说明

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