home *** CD-ROM | disk | FTP | other *** search
- <!--this is database search engine, here it is looking for webpages from a table called pages-->
-
-
- <%
- Dim searchStrings
- Dim x
- Dim SQLString
-
- SQLString = "SELECT DISTINCT PageName FROM Pages, Gen_page WHERE Gen_Page.PageID = Pages.PageId"
- searchStrings = split(Request.Form("search"))
- for x = 0 to Ubound(searchStrings)
- 'Construct SQL query based on number of keywords in search string
- SQLString = SQLString & " AND (Gen_page.H1 like '%" & searchStrings(x) & "%' OR"
- SQLString = SQLString & " Gen_page.H2 like '%" & searchStrings(x) & "%' OR"
- SQLString = SQLString & " Gen_page.Para1 like '%" & searchStrings(x) & "%' OR"
- SQLString = SQLString & " Gen_page.Para2 like '%" & searchStrings(x) & "%' OR"
- SQLString = SQLString & " Gen_page.Para3 like '%" & searchStrings(x) & "%')"
- Next
- Set rs = Server.CreateObject("ADODB.Recordset")
- rs.open SQLString, "DSN=Learning;UID=;PWD=;"
- %>
- <CENTER><H1><FONT FACE="Arial" COLOR="#000080">Search Results</FONT></H1>
- <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
- <TR>
- <TH>Page Name</TH>
- </TR>
- <%
-
- Do Until rs.EOF
- response.write "<TR><TD>" & rs("PageName") & "</TD></TR>"
- rs.MoveNext
- Loop
- Response.Write "</TABLE>"
- rs.close
- %>