You can use the code that named search results output ajaxsearch.asp.
Code:
<! - # Include file = "commond123.asp" ->
<! - # Include file = "include / function123.asp" ->
<%
Dim Search_Word, XML_Result, rsSearch123, sqlSearch123
Set rsSearch123 = Server.CreateObject ( "ADODB.RecordSet")
Search_Word = CheckStr (Trim (Request.Form ( "searchword")))
XML_Result = "<? Xml version =" "1.0" "encoding =" "utf-8 ""?>< blogsearch>"
IF Search_Word <> Empty Then
sqlSearch123 = "SELECT log_ID, log_Title, log_Content FROM blog_Content WHERE log_Title LIKE '%" & Search_Word & "%' AND log_IsShow = True ORDER BY log_ID DESC"
rsSearch.open sqlSearch, Conn, 1,1
IF rsSearch.BOF AND rsSearch.EOF Then XML_Result = XML_Result & "<result> <logid> # </ logid> <logtitle /> </ result>"
Do While Not rsSearch.EOF
XML_Result = XML_Result & "<result> <logid>" & rsSearch ( "log_ID ")&"</ logid> <logtitle> <! [CDATA [" & rsSearch ( "log_Title ")&"]]></ logtitle> </ result ""
rsSearch.MoveNext
Loop
Else
XML_Result = XML_Result & "<result> <logid> # </ logid> <logtitle /> </ result>"
End IF
XML_Result = XML_Result & "</ blogsearch>"
Response.ContentType = "application / xml"
Response.Write (XML_Result)
%>
With the back part of the search results output, you can start writing front part of the search. The first thing needed is to give the user to enter search keywords and display the search results. Check and reply.
Bookmarks