當前位置:編程學習大全網 - 源碼下載 - 如何在ASP動態網頁中實現搜索功能

如何在ASP動態網頁中實現搜索功能

我的理解:

當前頁面只顯示壹個按鈕和壹個文本框

新開壹個頁面,專門用來顯示結果

以下內容為在網上找到的搜索代碼

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#i nclude file="manage/inc/config.asp"-->

<!--#i nclude file="inc/conn.asp"-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "p = false;

var cal2 = new calendar1(document.forms['frmdata'].elements['expiredate']);

cal2.year_scroll = true;

cal2.time_comp = false;

</script></TD>

</TR>

<TR>

<TD align=right width="31%" height=30>價格範圍:</TD>

<TD width="69%"> <input name="smallprice" type="text" id="smallprice" size="5" >

<input name="largeprice" type="text" id="largeprice"

size="5" >

</TD>

</TR>

<TR>

<TD align=right height=30>分類:</TD>

<TD><select name=code>

<option value="" selected>所有圖書</option>

<%

set rs=server.CreateObject("adodb.recordset")

rs.open "select * from category",conn,1,1

do while not rs.eof

%>

<option value="<%=rs("categoryid")%>" ><%=rs("category")%></option>

<%

rs.movenext

loop

rs.close

set rs=nothing

%>

</select></TD>

</TR>

<TR>

<TD align=right height=30>排序字段:</TD>

<TD><input name="OrderField" type="radio" value="adddate" checked>

添加日期? <input type="radio" name="OrderField" value="productdate">

出版日期

<input type="radio" name="OrderField" value="price2">

價錢(會員價)

<br>

<br> <input type="radio" name="OrderField" value="vipprice">

價錢(VIP)

<input type="radio" name="OrderField" value="pagenum">

頁數<input type="radio" name="OrderField" value="discount">

折扣</TD>

</TR>

<TR>

<TD align=right width="31%" height=30>排序方式:</TD>

<TD width="69%"><input type="radio" name="Order" value="ASC">

升序

<input name="Order" type="radio" value="DESC" checked>

降序</TD>

</TR>

<TR align=center>

<TD height=40 colSpan=2><INPUT type=submit value=開始搜索 name=Submit2 onClick="return search()"> </TD>

</TR>

</TABLE>

</FORM></td>

</tr>

</table>

<!--#i nclude file="foot.htm"-->

</body>

</html>

  • 上一篇:寶貝視頻源代碼
  • 下一篇:捐贈h5源代碼
  • copyright 2024編程學習大全網