Index of /selcukhistoloji/cgi-bin
Name Last modified Size Description
Parent Directory 19-Oct-2009 19:46 -
_vti_cnf/ 03-Feb-2002 05:26 -
SEARCH.HTM 03-Feb-2002 05:26 1k
Readme for Simple Search
chmod the search.cgi to 755 or rwx-rx-rx
The search engine should work as is in your cgi-bin. It is set up to search
your parent directory, sub-directories,and sub-sub-directories.
Directory of ~John Doe
|
|
cgi-bin
| |
| search.cgi
|
|
sub-1
|
|
sub-2
As is presently set up the search engine will search all of the directories
except the cgi-bin. It searches for htm and html files only. If you want to
search text files, or any other files, just add the code to the @files array
EXCERPT FROM SEARCH.CGI
# Where are your files you want to search? The default below will search
# down 2 levels or subdirectories (* = base_dir. */ = base/sub etc.)
@files = ('*.htm','*/*.htm','*/*/*.htm','*.html','*/*.html','*/*/*.html');
If for example you want to search .txt files add to or change the @files
array to: @files = ('*.txt','*/*.txt' . . .)
Or to be able to search 3 sub-directories down add: '*/*/*/*.htm' to the
array.
You can also specify directories to search in the array:
('sub-1/*.htm', 'sub-2/*.htm', . . .) and search only those directories.
I have set up the script so that the user can select a directory to search
from the html form, using a drop-down list. If you don't want to use this
feature, remove all of this section of code from the html page. And in the
cgi, set the $seperate_dir option to '0'
EXCERPT FROM SEARCH.CGI
# If you want the user to be able to search individual directories, then
# put a '1' in the $seperate_dir = '1'; variable - or '0' for no.
$seperate_dir = '0';
EXCERPT FROM SEARCH.HTM
Area to Search <select name="directory">
<OPTION VALUE="all">All Files <! ## Don't change this line>
<OPTION VALUE="banner/*.htm">Banner
<OPTION VALUE="mailto/*.htm">Mailto
<OPTION VALUE="faq/*.htm">FAQ
</select>
-----------------------
EXCERPT FROM SEARCH.CGI
# If you use the sample text option enter the maxium number of charactors
# to be returned to the user ( 100 equals about 20 words )
$sample_text = '200';
The Show Sample Text routine is not prefect, and I will continue to work on
it. The routine strips off all HTML tags within each file it finds, and
shows the text left behind. If the page has nothing but gif's there will
be no sample text with the file that is returned from a search. Also if
the first *number of charactors the script finds for the sample text is all
in tags it will not show any sample text for that file.
If you do not want to use the sample text option, just remove the code from
the HTML page, and set the value for $show_sample_text to '0' in the cgi.