<% DIM Listoffilesfound,Thefile,Thefolder,Folderpath,FileHref if request.form="" then SendForm() else SearchTerm = Server.HTMLencode(request.form("term")) SearchTermArray=Split(SearchTerm," ") MaxSearchTerms=ubound(SearchTermArray) Folderstosearch="/crawford/public_html" DonotsearchthisFiles ="" Folderpath="d:\http_root" ' Search folders FolderstosearchArray=Split(Folderstosearch,",") Maxfolders=ubound(FolderstosearchArray) for i=0 to Maxfolders Thefolder = FolderstosearchArray(i) Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(Folderpath & Thefolder) Set fc = f.Files For Each f1 in fc Wfile = f1.name Thefile=Thefolder & "/" & Wfile FileHref=Wfile if inStr(DonotsearchthisFiles,Thefile)=0 then Searchit() end if Next next ' Write search results Searchresponse() end if %><% Sub SendForm() %> Search
      Search     About Us     Site Map    CEO's Comments

 

   Home

   Residential Products

   Commercial Products

   Industrial Products

   Gate / Security Products

   Dock Equipment

   Parts Counter

   Services

   Wholesale Services

   Request for Information

Search term or phrase    
      Search     About Us     Site Map    CEO's Comments
  ©Copyright 2002 Crawford Door Sales, LLC. All rights reserved.
<% End Sub %><% Sub Searchresponse() %> Search Results
      Search     About Us     Site Map    CEO's Comments

 

   Home

   Residential Products

   Commercial Products

   Industrial Products

   Gate / Security Products

   Dock Equipment

   Parts Counter

   Services

   Wholesale Services

   Request for Information

Search Results
<% if Listoffilesfound="" then %> <% else Response.Write (Listoffilesfound) end if %>
The specified term or phrase was not found
      Search     About Us     Site Map    CEO's Comments
  ©Copyright 2002 Crawford Door Sales, LLC. All rights reserved.
<% End Sub %><% Sub Searchit() Thefilepath=Folderpath & Thefile Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.OpenTextFile(Thefilepath) ThecontentofFile = a.ReadAll a.close Findterms=0 for j=0 to MaxSearchTerms if instr(1,ThecontentofFile,SearchTermArray(j),1)>0 then Findterms=Findterms+1 end if next if Findterms=MaxSearchTerms+1 then if instr(1,ThecontentofFile,"",1)>0 and instr(1,ThecontentofFile,"",1)>0 then TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"",1)-1) TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"",1)-6) else TheTitle="No Title" end if Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE> <A HREF=" & FileHref & "> More </A></TD></TR>" end if End Sub %>