%
SearchTerm = request.form("term")
Novalid=" a b c d e f g h i j k l m n o p q r s t u v w x y z yes no and more"
NovalidResponse ="Go back and try again. Your search term is very common"
if instr(SearchTerm,Novalid)=0 then
Response. Write ("
Search results
")
FolderName= ""
ShowList()
else
Response.Write NovalidResponse
End if
SearchResponse=""
%>
<%
Sub ShowList()
FolderToCheck = server.mappath("\") &"/" & FolderName & "/"
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(FolderToCheck)
Set fc = f.Files
For Each f1 in fc
Wfile = f1.name
if right(Wfile, 5)=".html" OR right(Wfile, 4)=".asp" then
Wfile2 = FolderToCheck & Wfile
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Wfile2)
ct = a.ReadAll
a.close
ct2=lcase(ct)
SearchTerm2 = lcase(SearchTerm)
if instr(ct2,SearchTerm2)>0 then
if instr(ct,"")>0 then
longitud=instr(ct,"")
longitud=longitud -1
ct=left(ct,longitud)
longitud2=len(ct)
longitud=instr(ct,"")
longitud=longitud2 -longitud -6
ct=right(ct,longitud)
else
if instr(ct,"")>0 then
longitud=instr(ct,"")
longitud=longitud -1
ct=left(ct,longitud)
longitud2=len(ct)
longitud=instr(ct,"")
longitud=longitud2 -longitud -6
ct=right(ct,longitud)
end if
end if
SearchResponse= SearchResponse +""+ ct + " | " + " More |
"
longitud=0
ct=""
end if
end if
Next
Response.Write ("Search results")
Response.Write ("")
Response.Write ("")
if SearchResponse<>"" then
Response.Write SearchResponse
else
Response.Write ("The specified term or phrase was not found |
")
end if
Response.Write ("
")
Response.Write ("")
Response.Write ("")
End Sub
%>