贴吧用户_0VZZRSM My小雨滴
关注数: 10 粉丝数: 121 发帖数: 3,547 关注贴吧数: 24
新人求助,关于搜索结果变色代码 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="../Connections/conn.asp" --> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_conn_STRING Recordset1.Source = "SELECT * FROM 统计 WHERE ID LIKE '%"+Request.Form("soso")+"%' OR 姓名 LIKE '%"+Request.Form("soso")+"%' " Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd&urlrefer=e9b2a1e0c6d358d677c4ee0138b67400"> <html xmlns="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml&urlrefer=d0f4243b5ce5e5fa54fdafc10831c319"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head> <body> <table width="100%" border="1"> <tr> <td>1ID</td> <td>姓名</td> </tr> <% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %> <tr> <td><%=(Recordset1.Fields.Item("型号").Value)%></td> <td><%=(Recordset1.Fields.Item("姓名").Value)%></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Recordset1.MoveNext() Wend %> </table> </body> </html> <% Recordset1.Close() Set Recordset1 = Nothing %>我这表只是一个例子,表头有姓名,性别,年龄,户籍,住址等,我是通过学号,或者姓名查找的,如果写学号,关键字学号变色,如果写张三,张三变色,如果写19,年龄19变色,如果写河北,河北变色,网上有说replace的,,可是不知道加到哪。
1 下一页