Hi, i am designing a new site and i want to add a search bar to the site so users can search my site. I do not want to use other search utilities such as a google search bar. I want to add my own search bar that will search my site. Can someone please point me in the right direction please
If your site content is in a daatabase, you can write a search engine that queries the database fro your content.
You will need some sort of database to store the search index, unless your site is very small. If it's just a handful of pages, you can build an index and store it in a flat file. This will not scale well though.
It won't work out, as you'd have to store each individual keyword, and update it as your pages change. Its easier to use something like freefind.com If you want to do that way, I suggest moving all your content to a database, and then writing a S.E. based on that. That will work, a few explode() statements to cut sentences and you're there. Just use a (My)SQL query like: SELECT * FROM `content` WHERE `body` LIKE '%keyword%' (untested) Jay
This website could be of use. It lists some site search scripts etc and other sites that offer the service. Includes instructions on how to set up site search. http://www.thefreecountry.com/php/site-search-engine-scripts.shtml