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.
 
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:
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.
 
of course :)

Setup and RSS/Atomic feed (which you can use locally as well) and searching will be a LOT easier, and quicker.

Which language are you using?
 
My experience with RSS is measured in Nano's, so all I can do is point you to an RSS package form PEAR -> http://pear.php.net/package/XML_RSS

I'm certain other members have had RSS/Atomic feeds up and running and I doubt they are much fuss at all, especially with a package like that above.

:)
 
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