支持加号空格的查询
程序员文章站
2022-04-14 18:50:41
复制代码 代码如下:<% response.write "关键字:("&trim(request("q"))&")"&"
" x=repl...
" x=repl...
复制代码 代码如下:
<%
response.write "关键字:("&trim(request("q"))&")"&"<hr>"
x=replace(trim(request("q"))," ",",")
'x=array(x)
t=split(x,",")
sql="select * from tb where kis<>0"
for i=0 to ubound(t)
if t(i)<>"" then
response.write "第"&i+1&":"&t(i)&"<hr>"
sql=sql&" or title like '"&t(i)&"'" '这个是关键
end if
next
response.write sql
%>
<form action="">
<table>
<tr>
<td><input name="q" onkeyup="this.value=this.value.replace(/\s+/g,' ')"><input type="submit" value="查
询"></td>
</tr>
</table>
</form>
上一篇: ASP中通过该日历算法实现的具体代码
下一篇: 一个asp快速字符串连接类