我给一个你吧!
你修改一下就可以用了
<%
const maxrecord=20
currentpage=request("currentpage")
if currentpage<=0 then
currentpage=1
end if
keys=request.form("keys")
if keys="" then
keys=request("keys")
end if
page=request.form("page")
allpage=request("allpage")
if IsNumeric(page) and page<>"" then
if CLng(page)<=CLng(allpage) and CLng(page)>=1 then
currentpage=page
end if
end if
types=request.form("types")
if types="" then
types=request("types")
end if
Function autokey(strkey)
const lngSubKey=2
dim lngLenkey,strNew1,i,strSubKey
if instr(strKey,"=")<>0 or instr(strKey,"'")<>0 or instr(strKey," ")<>0 or instr(strKey,"
")<>0 or instr(strKey,chr(34))<>0 or instr(strKey,"\")<>0 or instr(strKey,"<")<>0 or instr(strKey,">")<>0 then
Response.redirect("checkerror.html")
end if
lngLenkey=Len(strKey)
Select Case lngLenKey
Case 0
Response.redirect("checkerror.html")
Case 1
strNew1=""
Case Else
For i=1 To lngLenKey-(lngSubKey-1)
strSubKey=Mid(strKey,i,lngSubKey)
strNew1=strNew1&" or maintitle like '%"&strSubKey&"%'"
Next
End Select
autokey="Select * from chattext1 where maintitle like '%"& strKey &"%'"&strNew1
End Function
%>
<p align="center"><font size="6" color="#9966FF">搜索结果</font></p>
<div align="center">
<table border="0" width="1000" cellspacing="1" id="table1" height="30">
<tr>
<td>
<p align="right"><a href=context1.asp?tagtmp=all><font color="#FF0000">编程技术</font></a> <a href="right.asp"><font color=red>返回首页</font></a>
</font></td>
</tr>
</table>
</div>
<hr color="#FF33CC" width="1000">
<div align="center">
<%
if types="论坛贴子" then
sql=autokey(keys)
set obj=server.createobject("ADODB.Connection")
obj.open"dsn=user;"
set rs=server.createobject("ADODB.recordset")
rs.open sql,obj,1,1
if not (rs.eof and rs.bof) then
rs.PageSize=maxrecord
totalpage=rs.PageCount
totalrecord=rs.RecordCount
%>
<table border="0" width="1000" color="white">
<tr><td align="left">共 <%=totalrecord%> 个搜索结果 总共<font color=red><%=totalpage%></font>页 当前为第<font color=red><%=currentpage%></font>页</td></tr>
</table>
<table border="0" width="1000" cellspacing="1" bgcolor="#C8E3FF" id="table2">
<tr>
<td align=center width=250>标题</td><td align=center width=250>类型</td><td align=center width=250>作者</td><td align=center width=250>被回复次数</td>
</tr>
<tr>
<td align=center width=250><hr align=center width=249 color=red></td><td align=center width=250><hr align=center width=249 color=red></td><td align=center width=250><hr align=center width=249 color=red></td><td align=center width=250><hr align=center width=249 color=red></td>
</tr>
<%
j=0
rs.Move (currentpage-1)*maxrecord
do while (not rs.eof)
if rs("tag")="HTML" then tptag="HTML"
if rs("tag")="JAVA" then tptag="JAVA"
if rs("tag")="C" then tptag="C语言"
if rs("tag")="CC" then tptag="C++"
if rs("tag")="CCC" then tptag="C#"
if rs("tag")="数据库" then tptag="数据库"
if rs("tag")="VB" then tptag="VB"
%>
<tr>
<td align=left width=250><a href=dealchecklook.asp?offer=<%=rs("offer")%>&tag=<%=rs("tag")%>&id=<%=rs("ID")%> target="_blank"><%=rs("maintitle")%></a></td>
<td align=center width=250><%=tptag%></td>
<td align=center width=250><%=rs("offer")%></td>
<td align=center width=250><%=rs("number")%></td>
</tr>
<tr>
<td align=center width=250><hr align=center width=249></td><td align=center width=250><hr align=center width=249></td><td align=center width=250><hr align=center width=249></td><td align=center width=250><hr align=center width=249></td>
</tr>
<%
j=j+1
if j>=maxrecord then exit do
rs.MoveNext
loop
%>
<%
else
%>
<br><p align=center>没有找到符合关键字的内容</p>
<%
end if
end if
%>
</table>
<hr width=1000 align=center>
<table width=1000 align=center>
<%
if cint(currentpage)<>1 then
%>
<a href=dealfind.asp?currentpage=1&keys=<%=keys%>&types=<%=types%>><font color=red>第一页</font></a>
<%
end if
if cint(currentpage)<>cint(totalpage) then
%>
<a href=dealfind.asp?currentpage=<%=totalpage%>&keys=<%=keys%>&types=<%=types%>><font color=red>最后页</font></a>
<%
end if
if totalrecord<=maxrecord then
%>
上一页 下一页
<%
else
if cint(currentpage)=cint(totalpage) then
currentpage=cint(currentpage)-1
%>
<a href=dealfind.asp?currentpage=<%=currentpage%>&keys=<%=keys%>&types=<%=types%>><font color=red>上一页</font color=red></a> 下一页
<%
else
if currentpage=1 then
currentpage=currentpage+1
%>
上一页 <a href=dealfind.asp?currentpage=<%=currentpage%>&keys=<%=keys%>&types=<%=types%>><font color=red>下一页</font></a>
<%
else
currentpage1=currentpage-1
currentpage2=currentpage+1
%>
<a href=dealfind.asp?currentpage=<%=currentpage1%>&keys=<%=keys%>&types=<%=types%>><font color=red>上一页</font></a> <a href=dealfind.asp?currentpage=<%=currentpage2%>&keys=<%=keys%>&types=<%=types%>><font color=red>下一页</font></a>
<%
end if
end if
end if
%>
</td><td align=right><form action=dealfind.asp?keys=<%=keys%>&allpage=<%=totalpage%>&types=<%=types%>¤tpage=<%=currentpage%> name="go" method="post">
跳到 <input type="text" name="page" value="" width="10"> 页 <input type="submit" value="
GO
">
</form></td></tr>
</table>
</div>
<p align="center"> </p>
因为是从我的网站中复制过来的,所你修改下就可以用了