<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data source = " &  Server.MapPath("dataasdfsd3fvdfsdfdsfd787fsdfsdsdgfsdg/7dataasdfsd3fvdfsdfdsfd787fsdfsdsdgfsdg.mdb")
'dim keywords,keywords2,stype,rs
%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>搜索</title></head><body leftmargin="0" topmargin="0"><br>
<div align="center">
<table width="750" border="0" cellpadding="0" cellspacing="1" bgcolor="#4C9DFE"><tr>
<td bgcolor="#3179CE" colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="3"><tr>
<td width="100%"><strong><font color="#FFFFFF">贴吧查询页面 </font></strong></td></tr></table></td></tr><tr>
<td bgcolor="#4C9DFE" colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td width="1%">&nbsp; </td>
<td width="65%" valign="top" style="font-size: 11pt"><%
keywords=trim(request("keywords"))
keywords2="<b><font color=red>"&trim(request("keywords"))&"</font></b>"
stype=trim(request("stype"))
if stype="" then
stype=1
end if
if keywords="" then
response.write"请不从外部提交数据或输入正确的关键字进行查询！http://www.chaotie.com"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
select case stype
case 2
rs.open "select * from Dv_Board where BoardType= '"&keywords&"' ",conn,1,1
case 1
rs.open "select * from Dv_Board where BoardType like '%"&keywords&"%' ",conn,1,1
end select%>
<%
if rs.recordcount<>"0" then 
if rs.recordcount="1" then 
if stype="2" then
%>
<font color="#FFFFFF">贴吧名称：</font><b><font color="#FF0000"> <%=keywords%> </font>
<font color="#FFFFFF">,已存在此贴吧,<a target="_blank" href=index.asp?boardid=<%=rs("boardid")%>>进入<%=Replace(rs("BoardType"),keywords,keywords2)%></a>或重新查询!</font></td>
<% Response.Redirect "index.asp?boardid="&rs("boardid")&"" %><%else%> 
<font color="#FFFFFF">贴吧名称：</font><b><font color="#FF0000"> <%=keywords%> </font>
<font color="#FFFFFF">,仅查询到一个类似贴吧,进入<a  target="_blank" href=index.asp?boardid=<%=rs("boardid")%>><%=Replace(rs("BoardType"),keywords,keywords2)%></a></font></td>
<%
end if
else%>
<font color="#FFFFFF">查询关键字：</font><font color="#FF0000"> <%=keywords%> </font>
<font color="#FFFFFF">,共找到</font><font color="#FF0000"> <%=rs.recordcount%> </font><font color="#FFFFFF">个类似贴吧</font></td>


<td width="31%"></td><td width="2%" align=right>　</td></tr></table></td></tr><tr>
<td colspan="3"><table width="97%" border="0" align="center" cellpadding="5" cellspacing="1"><%
do while not rs.eof
%> <tr><%
for j=1 to 5
if rs.eof then
response.write"<td bgcolor=#E8F5FF></td>"
else
%> <td bgcolor="#E8F5FF" width="20%" valign="top"><a  target="_blank" href=index.asp?boardid=<%=rs("boardid")%>><%=Replace(rs("BoardType"),keywords,keywords2)%></a> </td><%
rs.movenext
end if
next
%> </tr><%
if rs.eof then exit do
rs.movenext
loop
%> <%end if%>
</table></td></tr><%else%>
无此贴吧,请<a href="Dv_plus/userboard.asp?action=add&keywords=<%=keywords%>">新建</a>或查询类似贴吧
<% Response.Redirect "Dv_plus/userboard.asp?action=add&keywords="&keywords&"" %>
<%end if%><tr><td width="16" height="30"> </td>
<td width="402" height="30"><form name="urlsearch" method="post" action="url_search.asp">
<font color="#FFFFFF">重新查询:</font><select name="stype" id="stype">
<% 
if rs.recordcount="0" then 
%>
<option value="1" selected>类似贴吧</option><option value="2">贴吧名称</option>
<%else%>
<option value="1">类似贴吧</option><option value="2" selected>贴吧名称</option>
<%end if
rs.close
set rs=nothing
%>
</select><input name="keywords" type="text" value="<%=keywords%>" size="15" maxlength="40" onClick=javascript:this.value=""> <input class=button_index  type="button" name="bub" value="搜 索" onClick="checksea()"> <script language="VBScript">
<!---
function checksea()
if urlsearch.keywords.value="" or urlsearch.keywords.value="贴吧名称" then
msgbox"请正确输入要搜索的贴吧名称！"
urlsearch.keywords.focus
else
urlsearch.submit
end if
end function
-->
</script></td>
<td width="351" height="30"></form>
</td>
</tr></table></div>

</body></html>