我写了一个代码,不能使现分类搜索,
高手帮忙看一下,
dim rs,keyword,keywordlist,path,sql
keyword=request.form("keyword")
name=request.form("classname")
mode=request.form("title1")
if keyword="" then
response.write "<script>window.alert('请输入关键词');history.back();</script>"
response.end
else
keyword=replace(keyword,","," ")
keyword=replace(keyword,","," ")
keyword=replace(keyword,"]"," ")
keyword=replace(keyword,"["," ")
keyword=trim(keyword)
keywordlist=split(keyword)
%><table border=0 cellpadding=0 cellspacing=0 width=100% >
<tr>
<td height="20" colspan="2" background="images/menu_bg3.gif"><%if keyword<>"" then %> 站内搜索→<%=name%>→<%=mode%>→关键词→【<%=keyword%>】<%else%>站内搜索<%end if%></td>
</tr>
<%
select case name
case "网页特效"
if mode="按主题" then
mode="title"
elseif title="按内容" then
mode="content"
else
mode="title"
end if
sql="select * from News where "&mode&" like '%"&keyword&"%'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td><br><br><p align=center><font color=red>没有相关信息</font></p></td></tr>"
response.end
else
do while not(rs.eof)
%> <tr>
<td width="487" style="border-bottom:#999999 1px dotted"><p style="line-height:150%"><img src="images/title.gif" width="9" height="11"><a href='show.asp?id=<%=rs("id")%>' target=_blank><%=rs("title")%></a>
</td>
<td width="61" style="border-bottom:#999999 1px dotted"><%=rs("infotime")%></td>
</tr>
<%
rs.movenext
if rs.eof then exit do
loop
end if
[求助]i不能使现分类搜索