搜索页面
<form name="form" method="get" action="1.asp">
<input type="text" name="key" size="15"> <input type="submit" value="检索" name="Submit"></form>
asp
<%
'连接数据库代码
dim key
if Request.QueryString("key")="" then
response.write "<script>alert('请输入关键字!!');location.href='javascript:history.back(1)';</Script>"
else
key=Request.QueryString("key")
end if
%>
<select name="UserQusetion" class="btn2" size="1">
<option selected value>请选择</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from user where user= '"&key&"'"
rs.open sql,conn,1,1
do while not rs.eof%>
<option value="<%=rs("id")%>"><%=rs("wenti")%></option>
<%rs1.movenext
loop
rs.close
set rs=nothing%>
</select>