| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 476 人关注过本帖
标题:[求助]搜索问题
取消只看楼主 加入收藏
mai_25
Rank: 3Rank: 3
来 自:上海
等 级:论坛游侠
帖 子:206
专家分:131
注 册:2006-7-22
结帖率:65.22%
收藏
 问题点数:0 回复次数:0 
[求助]搜索问题
这是搜索面页代码:<form action="search.asp?title=search" method="post" name="form1" target="_blank">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">关键字搜索:</td>
<td align="center"><input name="tit" type="text" id="tit" size="15"></td>
<td align="center">信息种类:</td>
<td align="center"><select name="typ" id="typ">
<option value="" selected>不限</option>
<option value="1">游客求购</option>
<option value="2">旅行社求购</option>
<option value="3">酒店求购</option>
<option value="4">车队求购</option>
<option value="5">景点求购</option>
<option value="6">散客线路</option>
<option value="7">同行报价</option>
<option value="8">折扣酒店</option>
<option value="9">特价票务</option>
<option value="10">车辆供应</option>
<option value="11">优惠门票</option>
<option value="12">工艺品出售</option>
<option value="13">求职信息</option>
<option value="14">招聘信息</option>
</select></td>
<td align="center"><input type="submit" value="开始搜索"></td>
</tr>
</table>
</td></form>



下面是搜索结果:<%
if Request.QueryString("title")="search" Then
if Request.form("typ")="1" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ2 = '2' and send ='杭州' and audi = '是' and dat > date()-val and typ1='9' order by id desc"
elseif Request.form("typ")="2" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ2 = '2' and send ='杭州' and audi = '是' and dat > date()-val and (typ1='2') order by id desc"
elseif Request.form("typ")="3" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ2 = '2' and send ='杭州' and audi = '是' and dat > date()-val and (typ1='4') order by id desc"
elseif Request.form("typ")="4" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ2 = '2' and send ='杭州' and audi = '是' and dat > date()-val and (typ1='26') order by id desc"
elseif Request.form("typ")="5" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ2 = '2' and send ='杭州' and audi = '是' and dat > date()-val and (typ1='3') order by id desc"
elseif Request.form("typ")="6" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ4 = '5' and typ2 = '1' and send ='杭州' and audi = '是' and dat > date()-val and typ1='2' and (typ3 like '%9%' or typ3 like '%1%') order by id desc"
elseif Request.form("typ")="7" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ4 = '5' and typ2 = '1' and send ='杭州' and audi = '是' and dat > date()-val and typ1='2' and typ3 like '%2%' order by id desc"
elseif Request.form("typ")="8" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ4 = '3' and send ='杭州' and audi = '是' and dat > date()-val order by id desc"
elseif Request.form("typ")="9" Then
exec="select * from info where tit like '"&request.form("tit")&"' (typ4 = '7' or typ4 = '8' or typ4 = '9') and typ2 = '1' and audi = '是' and dat > date()-val and send='杭州' order by id desc"
elseif Request.form("typ")="10" Then
exec="select * from info where tit like '"&request.form("tit")&"' send='杭州' and typ2 = '1' and audi = '是' and dat > date()-val and typ1='1' order by id desc"
elseif Request.form("typ")="11" Then
exec="select * from info where tit like '"&request.form("tit")&"' send='杭州' and typ2 = '1' and audi = '是' and dat > date()-val and typ1='4' order by id desc"
elseif Request.form("typ")="12" Then
exec="select * from info where tit like '"&request.form("tit")&"' typ4 = '2' and typ2 = '1' and audi = '是' and dat > date()-val and send='杭州' and thj='商务礼品' order by id desc"
elseif Request.form("typ")="13" Then
exec="select * from info where tit like '"&request.form("tit")&"' send='杭州' and typ2 = '4' and audi = '是' and dat > date()-val order by id desc"
elseif Request.form("typ")="14" Then
exec="select * from info where tit like '"&request.form("tit")&"' send='杭州' and typ2 = '3' and audi = '是' and dat > date()-val order by id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
rs.PageSize=20
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then
page=1
end if
if not rs.eof then rs.AbsolutePage=page
%>

请问这个搜索结果有什么问题吗?请各位快帮帮忙。
搜索更多相关主题的帖子: 搜索 
2006-08-24 18:03
快速回复:[求助]搜索问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021903 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved