Search the Bagnall.net recipe database

Enter a key word:

<% dim strSearch strSearch = Request.Form("search") if strSearch <> "" then Response.Write "

You searched for '" & strSearch & "'.

" Dim strPathInfo, strPhysicalPath strPathInfo = Request.ServerVariables("SCRIPT_NAME") strPhysicalPath = Server.MapPath(strPathInfo) Dim objFSO, objFile, objFileItem, objFolder, objFolderContents, objSubFolders, objFolderItem dim objFileTextStream dim strText, strList dim strFileName, strFolderName, x x = 0 strList = "" set objFSO = createobject("Scripting.FileSystemObject") set objFile = objFSO.GetFile(strPhysicalPath) set objFolder = objFile.ParentFolder set objSubFolders = objFolder.SubFolders for each objFolderItem in objSubFolders strFolderName = objFolderItem.name if strFolderName <> "_vti_cnf" then set objFolderContents = objFolderItem.Files 'if InStr(strFolderName,strSearch)>0 then if InStr(strFolderName,strSearch)>0 then for each objFileItem in objFolderContents strFileName = objFileItem.name if Right(strFileName,3)="htm" then 'set objFileTextStream = objFileItem.OpenAsTextStream(1, -2) 'strText = objFileTextStream.ReadAll x = x + 1 strList = strList & "" 'objFileTextStream.Close end if next else for each objFileItem in objFolderContents strFileName = objFileItem.name if Right(strFileName,3)="htm" then set objFileTextStream = objFileItem.OpenAsTextStream(1, -2) strText = objFileTextStream.ReadAll if InStr(strText,strSearch)>0 then x = x + 1 strList = strList & "" end if objFileTextStream.Close end if next end if end if next if x = 0 then Response.Write "

No recipes have been found.

" elseif x = 1 then Response.Write "

The following 1 recipe has been found:

" Response.Write strList else Response.Write "

The following " & x & " recipes have been found:

" Response.Write strList end if end if %>
NumberCategoryRecipe
" & x & ":" & strFolderName & "" & Left(strFileName,len(strFileName)-4) & "
" & x & ":" & strFolderName & "" & Left(strFileName,len(strFileName)-4) & "