📄 search.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../include/config.asp" -->
<!--#include file="../include/ServerControl.asp" -->
<%
session("mode") = "user"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="450" border="0" align="center" cellpadding="1" cellspacing="1" >
<tr>
<td width="10"> </td>
<td> </td>
<td width="10"> </td>
</tr>
<tr>
<td width="10"> </td>
<td><form name="frmSearch" method="post" action="Search.asp">
<input type="text" name="key" >
<select name="field" id="field">
<option value="name" selected>产品名称</option>
<option value="intro">产品介绍</option>
<option value="package">产品包装</option>
<option value="price">产品价格</option>
</select>
<%
dim cmbtype
dim aV,aL
aV = array("0")
aL = array("所有产品")
set cmbtype = new DBCombo
cmbtype.name = "type"
cmbtype.selected = "0"
cmbtype.setOptions aV,aL
cmbtype.writehtml "select * from product_type",session("conn")
%>
<input type="submit" name="Submit" value="查 询" >
</form></td>
<td width="10"> </td>
</tr>
<tr>
<td width="10"> </td>
<td>
<%
if Request.Form("Submit") <> "" then
dim key,fld,newstype,timeorder
key = trim(Request.Form("key"))
fld = trim(Request.Form("field"))
newstype = trim(Request.Form("type"))
'Response.Write key & fld & newstype & timeorder
dim str
if newstype = "0" then
if fld = "price" then
if key = "" then
str = "select * from v_product"
else
str = "select * from v_product where price = " & key
end if
else
str = "select * from v_product where " & fld & " like '%" & key & "%'"
end if
else
if fld = "price" then
if key = "" then
str = "select * from v_product where type_id = " & newstype
else
str = "select * from v_product where price = " & key & " and type_id = " & newstype
end if
else
str = "select * from v_product where " & fld & " like '%" & key & "%' and type_id = " & newstype
end if
end if
session("sqlString") = str
'Response.Write session("sqlString")
server.Execute("list_product.asp")
else if request.QueryString("page") <> "" then
server.Execute("list_product.asp")
end if
end if
'session("sqlString") = ""
%>
</td>
<td width="10"> </td>
</tr>
<tr>
<td width="10"> </td>
<td> </td>
<td width="10"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -