Documentation: NOTE: At this current moment it will search for a particular
phrase. I am yet to make it search for words entered in different
locations in searched text.
Well this ASP will allow you to scan all directories and subdirectories
in the path of the file. It will look for the text that was entered in
the search box and pull information about the file that that string was
found in. This is still a simple search engine so more updated with
better abilites will be comming soon.
Ok to explain what exactly happens. The code searchs ever file in the
start directory for instances of the string that is being searched. If
it finds the string in a file, it will then search for the file extention.
If the file extention is in the strFile variable it will then search
for the <TITLE> tag. If it finds the tag then it will get what ever
the title of the page is and place it as the title of the found file with
a link to the file. If it can't find the <TITLE> tag it will just give
the file a 'Untitled' title. Next after all this it will grab the first 200
non-tag characters of the file and display them as a brief description of
the file. Last after that is abit of info about when the file was last
modified and the file size. It then repeats the function until it get's to
the last file. After that it then changes to another folder and searches
that, and so on.
Setup:
First thing you will need to do is change the value of strRoot. You
will have to change this according to the main directory that you want the
search engine to start searching from. If you want it to search from the
main server root then change it to "/". If you are one a webhost that allows
ASP and you have a site like this, http://www.hostname.com/username/ then
you will have to change the strRoot to "/username/" so that is will start
searching in your home directory.
Add or take out any file extentions from the strFile value. Leave a
space between each extention (I don't think it makes a difference, but it
makes it nice and tidy). This will give you abit of security if you have
files that cotain information that you don't want people to find via a
search engine.
Updates:
Version 1.2 (Current) - Added Case Sensitive option, File
extention security, Description Length, Maximum amount of responses,
and Page Includes. (16/11/99)
Version 1.1 - Added feature of scanning all
directories of 'root' directory. (15/11/99)
Version 1.0 (Original) - Simple search capabilities of only
to directory that the ASP file was in. Limited to what output could
be shown. (14/11/99)