各位大虾,我已经把搜索系统做好了,但我想把搜索的关键字改为红色,只知道是用替换法作的,但不知道该怎么写这段代码,会用的朋友能帮忙写一下吗?非常感谢!!!
以下是我搜索页的源代码,希望会写的朋友帮我写一下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn/conn.asp"-->
<%
dim m,n
a=request.Form("tt"

set rs=server.CreateObject("ADODB.recordset"

sql="SELECT * FROM fenlen where xl LIKE '%"&a&"%' Order by uid desc"
rs.open sql,connstr,3,3
cc=rs.recordcount
if(cc=0) then
response.Write ("对不起!暂时还没有该类产品!<p><a href='001.asp'>点击这里返回</a>"

response.end()
else
end if
<% if(len(rs("cptxt"

)>100) then
else
end if
%>
<html>
<head>
<style type="text/css">
<!--
#f{
border-collapse: collapse;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>中国采购信息网</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#004E98" leftmargin="0" topmargin="0">
<div align="center">
<table width="625" height="305" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><div align="center">
<%
n=1
while not rs.eof and n<=rs.pagesize %>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="img/006.jpg" width="10" height="5"></td>
</tr>
</table>
<table width="570" height="22" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" id="f">
<tr>
<td width="72" height="20" align="right" valign="middle" class="txt"><div align="center"><strong>产品名称:</strong></div></td>
<td width="394" class="txt"> <%=(rs("cpname"

)%>
<div align="center"></div>
<div align="center"></div></td>
<td width="96" class="txt"><div align="center"><a href="fenle1.asp?id=<%=(rs("id"

)%>" target="_blank">查看详细信息</a></div></td>
</tr>
</table>
<% n=n+1
rs.movenext
wend
%>
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>