展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if Request.QueryString("action") = "search" then
bianhao = Request.Form("编号")
leixing = Request.Form("发布类型")
weizhi = Request.Form("位置")
shi = Request.Form("室")
jiage = Request.Form("价格")
lianxiren = Request.Form("联系人")
dianhua = Request.Form("联系电话")
sql = "select * from house where 1=1"
if bianhao <> "" then sql = sql & " and 编号='"&bianhao&"'"
if leixing <> "" then sql = sql & " and 发布类型='"&leixing&"'"
if weizhi <> "" then sql = sql & " and 位置 like '%"&weizhi&"%'"
if shi <> "" then sql = sql & " and 室='"&shi&"'"
if jiage <> "" then sql = sql & " and 价格>'"&jiage&"'"
if lianxiren <> "" then sql = sql & " and 联系人 like '%"&lianxiren&"%'"
if dianhua <> "" then sql = sql & " and 联系电话 like '%"&dianhua&"%'"
Set Rs = Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof
……
rs.movenext
wend
rs.close
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="?action=search">编号<input type="text" name="编号" id="编号" /><br />
发布类型(出租<input type="radio" name="发布类型" id="radio" value="出租" />出售<input type="radio" name="发布类型" id="radio" value="出售" />) <br />
位置<input type="text" name="位置" id="位置" /><br />
室<select name="室" id="室">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select><br />
价格
<input type="text" name="价格" id="价格" />
<br />
联系人
<input type="text" name="联系人" id="联系人" />
<br />
联系电话
<input type="text" name="联系电话" id="联系电话" />
<br />
<input type="submit" name="button" id="button" value="提交" />
<br />
</form>
</body>
</html>
希望对你有帮助
希望有帮助
<%
if Request.QueryString("action") = "search" then
bianhao = Request.Form("编号")
leixing = Request.Form("发布类型")
weizhi = Request.Form("位置")
shi = Request.Form("室")
jiage = Request.Form("价格")
lianxiren = Request.Form("联系人")
dianhua = Request.Form("联系电话")
sql = "select * from house where 1=1"
if bianhao <> "" then sql = sql & " and 编号='"&bianhao&"'"
if leixing <> "" then sql = sql & " and 发布类型='"&leixing&"'"
if weizhi <> "" then sql = sql & " and 位置 like '%"&weizhi&"%'"
if shi <> "" then sql = sql & " and 室='"&shi&"'"
if jiage <> "" then sql = sql & " and 价格>'"&jiage&"'"
if lianxiren <> "" then sql = sql & " and 联系人 like '%"&lianxiren&"%'"
if dianhua <> "" then sql = sql & " and 联系电话 like '%"&dianhua&"%'"
Set Rs = Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof
……
rs.movenext
wend
rs.close
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="?action=search">编号<input type="text" name="编号" id="编号" /><br />
发布类型(出租<input type="radio" name="发布类型" id="radio" value="出租" />出售<input type="radio" name="发布类型" id="radio" value="出售" />) <br />
位置<input type="text" name="位置" id="位置" /><br />
室<select name="室" id="室">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select><br />
价格
<input type="text" name="价格" id="价格" />
<br />
联系人
<input type="text" name="联系人" id="联系人" />
<br />
联系电话
<input type="text" name="联系电话" id="联系电话" />
<br />
<input type="submit" name="button" id="button" value="提交" />
<br />
</form>
</body>
</html>
希望对你有帮助
希望有帮助
追问
亲,你是高手,我是新手,我看不懂代码,不会修改,
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询