📄 search.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Response.Buffer = True %>
<!--#include file="conn.asp"-->
<!--#include file="asptbsys.asp"-->
<!--#include file="asptbcom.asp"-->
<link href="css.css" rel="stylesheet" type="text/css">
<%
skey=request.form("key")
if skey="" then
skey=Trim(request("key"))
end if
skey=Replace(skey,"'","")
skey=replace(skey,"<","<")
skey=replace(skey,">",">")
savekey=skey
savekey=Replace(savekey,">","")
savekey=Replace(savekey,"<","")
savekey=Replace(savekey,"(","")
savekey=Replace(savekey,")","")
savekey=Replace(savekey,"[","")
savekey=Replace(savekey,"]","")
savekey=Replace(savekey,"`","")
savekey=Replace(savekey,"~","")
savekey=Replace(savekey,"!","")
savekey=Replace(savekey,"@","")
savekey=Replace(savekey,"#","")
savekey=Replace(savekey,"$","")
savekey=Replace(savekey,"%","")
savekey=Replace(savekey,"^","")
savekey=Replace(savekey,"&","")
savekey=Replace(savekey,"*","")
savekey=Replace(savekey,"_","")
savekey=Replace(savekey,"+","")
savekey=Replace(savekey,"|","")
savekey=Replace(savekey,"\","")
savekey=Replace(savekey,"=","")
savekey=Replace(savekey,"-","")
savekey=Replace(savekey,"{","")
savekey=Replace(savekey,"}","")
savekey=Replace(savekey,";","")
savekey=Replace(savekey,"'","")
savekey=Replace(savekey,":","")
savekey=Replace(savekey,",","")
savekey=Replace(savekey,".","")
savekey=Replace(savekey,"/","")
savekey=Replace(savekey,"?","")
response.write""&asptbtop&""
%>
<table width=295 border="0" align="center" cellpadding="0">
<tr>
<td align="center" class=zxtd><form name="form1" method="post" action="search.asp?key=<%=skey%>">
<input name="key" type="text" value="<%=skey%>" size="30">
<input type="submit" name="Submit" value="文章搜索">
<br>
<input name="rad" type="radio" value="1" checked>
本站搜索
<input type="radio" name="rad" value="2">
网际搜索 |<a href=search.asp?key=美女>美女</a>|<a href=search.asp?key=图片>图片</a>|<a href=search.asp?key=asp>asp</a>|<a href=search.asp?key=论坛>论坛</a>|
</form></td>
</tr>
</table>
<%
call asptbvc(asptbcopy)
rad=request.form("rad")
if skey<>"" then
keysave="Select * from asptbkey where keyname='"& savekey & "'"
set rsasavekey=server.createobject("adodb.recordset")
rsasavekey.open keysave,conn,1,3
if not rsasavekey.eof then
conn.Execute("update asptbkey set hitkey=hitkey+1 where keyname='"&savekey&"'")
else
rsasavekey.AddNew
rsasavekey("keyname")=savekey
rsasavekey("hitkey")= 1
rsasavekey.Update
end if
rsasavekey.close
set rsasavekey=nothing
keylikes=""
keyl="Select * from asptbkey where keyname like '%" & skey & "%'"
set rsakey=server.createobject("adodb.recordset")
rsakey.open keyl,conn,1,1
do while not rsakey.eof
keylikes=keylikes&" <a href=search.asp?key="&rsakey("keyname")&">"&rsakey("keyname")&"</a> "
rsakey.movenext
loop
rsakey.close
set rsakey=nothing
if rad="" or CInt(rad)=1 then
searchinfo="Select * from asptbinfo where shanzhu=0 and stitle like '%" & skey & "%' or asptbinfo like '%" & skey & "%'"
set rssc=server.createobject("adodb.recordset")
rssc.open searchinfo,conn,1,1
response.Write"<table width=778 border=0 align=center cellspacing=1 >"
If rssc.BOF And rssc.EOF Then
response.Write"<td><tr><table width=100% class=zhongtable2><tr><td>><a href=/>首页</a>><font color=#FF0000>未找到任何结果!!!</font></td></tr></table></td></tr>"
Response.Write "<tr><td><table width=100%/><tr><td>相关搜索:"&keylikes&"</td></tr></table></td></tr>"
Response.Write "</table>"
Else
rssc.PageSize = 10
page=CLng(request("page"))
if page<1 then
page=1
end if
If Page > rssc.PageCount Then
Page = rssc.PageCount
end if
rssc.AbsolutePage = Page
response.Write"<tr><td> <table width=100% class=zhongtable2><tr><td>><a href=/>首页</a>>搜索名称为“<font color=#FF0000>"& sKey &"</font>”的项,共找到 <font color=#FF0000>"& rssc.RecordCount &"</font> 项:</td></tr></table></td></tr> "
Response.Write "<tr><td><table width=100% class=pt12><tr><td>相关搜索:"&keylikes&"</td></tr></table></td></tr>"
for i=0 to rssc.PageSize
stitlekey=rssc("stitle")
rskey="<font color=#FF0000>"&skey&"</font>"
stitlekey=Replace(stitlekey,skey,rskey)
if userzhiwu=100 then
editshow=" [<a href=admin.asp?editinfo="&rssc("ids")&"&page="&request("page")&"&idl="&rssc("idl")&" target=_blank><font color=#FF0000>编辑</font></a>][<a href=admin.asp?delinfo="&rssc("ids")&"&idl="&rssc("idl")&" target=_blank><font color=#FF0000>删除</font></a>]"
end if
response.Write"<tr><td><table width=100%/><tr><td><a href=list.asp?idl="& rssc("idl") &"&ids="& rssc("ids") &" target=_blank>"& stitlekey&"</a> "&editshow&""
asptbinfokey=rssc("asptbinfo")
asptbinfokey=LCase(asptbinfokey)
asptbinfokey=Replace(asptbinfokey,"<","")
asptbinfokey=Replace(asptbinfokey,">","")
asptbinfokey=Replace(asptbinfokey,"<","")
asptbinfokey=Replace(asptbinfokey,">","")
asptbinfokey=Replace(asptbinfokey,"<br>","")
asptbinfokey=Replace(asptbinfokey,"<p>","")
asptbinfokey=Replace(asptbinfokey,"</p>","")
asptbinfokey=Replace(asptbinfokey,"</td>","")
asptbinfokey=Replace(asptbinfokey,"</tr>","")
asptbinfokey=Replace(asptbinfokey,"</table>","")
asptbinfokey=Replace(asptbinfokey,"<table>","")
asptbinfokey=Replace(asptbinfokey,"<tbody>","")
asptbinfokey=Replace(asptbinfokey,"</tbody>","")
if CInt(InStr(asptbinfokey,skey))>0 then
ss=InStr(asptbinfokey,skey)-10
if ss<1 then
asptbinfokey="…"&Mid(asptbinfokey,1,100)&"…"
else
asptbinfokey="…"&Mid(asptbinfokey,ss,100)&"…"
end if
asptbinfokey=Replace(asptbinfokey,skey,rskey)
else
asptbinfokey=Left(asptbinfokey,50)
end if
asptbinfokey="<br><span class=pt12>"&asptbinfokey&"</span>"
response.Write""& asptbinfokey &"</td></tr></table></td></tr>"
response.Write"<tr><td height=10></td></tr>"
rssc.MoveNext
If rssc.EOF Then Exit For
next
Response.write"<tr><td><table width=100%/><tr><td>第" & Page & "页/总共有" & rssc.PageCount & " 页 每页"& rssc.PageSize &"个主题"
If Page <> 1 Then
Response.Write "<A HREF=search.asp?key="&skey&"&Page=1>第一页</A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -