search engine

What is the most cost effective way of adding a search engine to my website?

 I am aware that there are  free ones available, but they tend to
contain a link to the site they came from, or the search results are  displayed on their site. This of course means that the whole colour  scheme of your site changes to theirs on the results page.

I don't mind paying a small amount  for a system.

                                    Any ideas

                                    Thanks

                                    Alex
alex_harrisAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ventolinConnect With a Mentor Commented:
http://searchbutton.com/

allows you to do what you want (including results formatting and reporting)...

-ventolin
0
 
furuCommented:
Try this:




                                 my($searchdir) = "yourdir/yoursubdir";

                                 # for top/bottom files....
                                 my($htmldir) = "yourdir/htmlpages";

                                 my($word) = param('keyword');

                                 opendir DIR, $searchdir;
                                 my(@files) = readdir DIR;

                                 foreach my $file (@files) {
                                  next if $file =~ m!^\.{1,2}!;
                                  next if -d "$searchdir/$file";
                                   
                                  open (FILE, "$searchdir/$file");
                                  my(@lines) = <FILE>;
                                  close FILE;
                                   
                                  foreach my $line (@lines) {
                                 # remove last i for case sensitive search.
                                   if ($line =~ m!$word!i) {
                                    push (@matches, $file);
                                   }
                                  }
                                 }

                                 # Matching files are now stored in @matches

                                 my($number_of_matches) = @matches;
                                 my($matchno); #counter

                                 foreach my $match (@matches) {
                                  $matchno++;
                                 # Modify after the next line to customize each match-line.
                                  push (@output_lines, <<__END_HTML__);
                                 $matchno. <A HREF="$match">$match</A><BR>
                                 <BR>
                                 __END_HTML__

                                 }


                                 # Looks for top.html and bottom.html. Modify these to change the output.
                                 open (FILE, "$htmldir/top.html");
                                 print <FILE>;
                                 close FILE;

                                 print @output_lines;

                                 open (FILE, "$htmldir/bottom.html");
                                 print <FILE>;
                                 close FILE;
0
 
furuCommented:
Ooops, forgot

use CGI qw(:standard);

at the start....
0
 
alex_harrisAuthor Commented:
Furu,

Thanks for the reply how exactly do I use this script on a UNIX server?
Thanks
0
 
furuCommented:
You paste it into a file, store it in your CGI-bin directory and set the proper permissions (don't know Unix so someone else might help you on the correct/best chmod-numbers).

That should be it. The script is not tested but should work, though. Tell me if you have problems.
0
All Courses

From novice to tech pro — start learning today.