Adding search to a site which isn't database driven

Associate
Joined
2 Aug 2005
Posts
680
Hi,

Is it possible to to add a search facility to a site which is made up of lots of html pages (not database driven)? The site is also password protected using htaccess so I can't add a Google search. Thanks.
 
Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
Assuming you have some kind of server side scripting language available then yes, although it could get a bit messy, as you'd have to search the contents of each file for the search term :p I expect you could refine it to some extent, so that it ignores contents of tags, or you could even make it look at <meta name="keyword" content="keywords,go,here" /> if you wanted to.
 
Last edited:
Caporegime
Joined
18 Oct 2002
Posts
29,491
Location
Back in East London
use cURL to retrieve the output from your scripts, then search through those.

It may be wise to have a keywords function on your output scripts so that it leaves out the HTML and just outputs the content for you to search easily.
 
Associate
Joined
22 Dec 2005
Posts
138
Alternatively you can use a program by 'coffee cup' I think it's called 'search'. google their website and you'll see which app it is, they do a few apps for web related things.

Your server will need PHP to run its scripts it generates, but basically you load up the html pages from your site into the application and it stores all the words in them to a file. It then generates the html code for your search button. You can tweak with layout and options.

Then you just upload its generated files to your site along with your adjusted html page that has the search code now pasted in.

good luck.
 
Back
Top Bottom