关于ASP搜索的问题?
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="Connections/web.asp"--><%Dimr...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/web.asp" -->
<%
Dim rs1__MMColParam
rs1__MMColParam = "1"
If (Request.Form("sw") <> "") Then
rs1__MMColParam = Request.Form("sw")
End If
%>
<%
Dim rs1
Dim rs1_numRows
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_web_STRING
rs1.Source = "SELECT * FROM ser WHERE Name like '%" + Replace(rs1__MMColParam, "'", "''") + "%'"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<div align="center">
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="500" border="0">
<tr>
<td><%=(rs1.Fields.Item("Name").Value)%> </td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</div>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
如何在这个页面给搜索出来的记录换上颜色……
像百度一样,搜索出来的记录是红色……
是不是用replace 做! 帮帮小弟吧…… 展开
<!--#include file="Connections/web.asp" -->
<%
Dim rs1__MMColParam
rs1__MMColParam = "1"
If (Request.Form("sw") <> "") Then
rs1__MMColParam = Request.Form("sw")
End If
%>
<%
Dim rs1
Dim rs1_numRows
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_web_STRING
rs1.Source = "SELECT * FROM ser WHERE Name like '%" + Replace(rs1__MMColParam, "'", "''") + "%'"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<div align="center">
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="500" border="0">
<tr>
<td><%=(rs1.Fields.Item("Name").Value)%> </td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</div>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
如何在这个页面给搜索出来的记录换上颜色……
像百度一样,搜索出来的记录是红色……
是不是用replace 做! 帮帮小弟吧…… 展开
1个回答
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询