<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% dim spword,sql_array,askword,newsword spword=removekg(safeStr(Request("spword"))) if spword="" then dumpMsg "参数错误","index.html" if instr(spword,"输入关键字搜索答案")>0 then dumpMsg "参数错误","index.html" if IsValidStr(spword)=False then dumpMsg "非法的搜索字符","index.html" sql_array = Split(spword, " ") For n = 0 To UBound(sql_array) If n = 0 Then newsword = "a_title like '%"&sql_array(n)&"%'" askword = "ask_title like '%"&sql_array(n)&"%'" Else newsword = newsword & " or a_title like '%"&sql_array(n)&"%'" askword = askword & " or ask_title like '%"&sql_array(n)&"%'" End If Next %> <%=spword%>搜索结果-口臭治疗网
<% dim a,sql,rs,i dim Topic,aTime,newsurl,classurl,flname,classname,menuname i=1 sql="SELECT a_id as id, a_title,a_class1,a_time,""tbl1"" as tbl FROM [article] WHERE a_shenhe=1 and ("&newsword&") UNION select ask_id as id,ask_title as a_title ,"""" as a_class1,ask_time as a_time,""tbl2"" as tb1 from [jiankang_ask] where ask_shenhe=1 and ("&askword&") order by a_time desc" 'response.Write(sql) set rs=Server.CreateObject("adodb.Recordset") a=setPage(30,sql,conn,rs) if rs.eof and rs.bof then set rs2=conn.execute("Select * from [search] where keyword='"&spword&"'") if rs2.eof then conn.execute("INSERT INTO [search] (keyword,cishu,ip) VALUES ('"&spword&"',1,'"&Getip()&"')") else conn.execute("UPDATE [search] set cishu=cishu+1,ip='"&Getip()&"',shijian='"&now()&"' where keyword='"&spword&"'") end if Response.Write("
没有相关数据, 您可以直接点击后面的免费咨询!免费咨询
") end if while not rs.eof and a(2)>0 Topic=rs("a_title") For ii = 0 To UBound(sql_array) Call BoldWord(Topic,sql_array(ii)) Next aTime=FormatDateTime(rs("a_time"),2) if rs("tbl")="tbl1" then newsurl=""&rs("id")&".html" set flname=conn.execute("select a_id,a_name,muluurl from [article_class] where a_id="&rs("a_class1")&"") classname=flname("a_id") menuname=flname("a_name") classurl=flname("muluurl") else classurl="/ask/" menuname="口臭问答" newsurl="ask"&rs("id")&".html" end if Response.Write(vbcrlf&"
"&vbcrlf) Response.Write("
["&menuname&"] "&Topic&"
"&vbcrlf) Response.Write("
["&aTime&"]
"&vbcrlf) Response.Write("
"&vbcrlf) if i mod 5=0 then response.write("
") end if i=i+1 rs.movenext a(2)=a(2)-1 wend rs.close set rs=nothing 'Call pageBar4(a,"spword="&server.URLEncode(spword)) %>