把你的文本框标题查找后面加一个下拉框,可以选择标题查找或内容查找
<form name="form1" method="post" action="search.asp">
<input type="text" name="keyword">
<select name="otype">
<option value="title">标题</option>
<option value="content">内容</option>
</select>
<input type="submit" name="submit1" value="提交">
<input type="reset" name="submit2" value="重置">
</form>
上面是提交表单
search.asp
<!--#include file="数据库链接文件"-->
<%
otype=request.form("otype")
keyword=request.form("keyword")
set rs=Server.CreateObject("adodb.recordset")
if otype="title" then
sql="select * from [tablename] where title like '%" & keyword & "%'"
elseif otype="content" then
sql ="select * from [tablename] where contetn like '%" & keyword & "%'"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
.....
else
....
end if
大致如此,楼主可以作个参考