28,391
社区成员
发帖
与我相关
我的任务
分享
<%
dim sql,textfield
textfield=request.form("textfield")
'这里你可以加上为空,或是过滤语句
sql="select url from 表 where title = '"&textfield&"'" '这个是sql语句,不过不建议用 = 号,因为效率不高
set rs=conn.execute sql
if not (rs.eof and rs.bof) then
response.redirect rs("url")
else
response.redirect abc.asp
end if
%>
<select name=xx onchange="javascript:window.location=this.value">
<option value="">请选择</option>
<%do while not rs.eof%>
<option value="http://<%=rs("url")%>"><%=rs("title")%></option> '如果你数据库里有http://那就不用加上了。
<%rs.movenext
loop%>
</select>
<%清空对象,销毁对象%>