I would like to put a search option on my website so people can type in a word and it will direct them to the most appropriate item or page.
Is there an easy way to do this ???
can any one tell me a please to get a code ???
I would like to put a search option on my website so people can type in a word and it will direct them to the most appropriate item or page.
Is there an easy way to do this ???
can any one tell me a please to get a code ???
How is your page set up? Does it use a database?
Corrections to my coding/thoughts welcome.
no. it has only static pages.
Well the results page would have to be a php page for this to work, but the other pages can remain the same as they are. You would also need a mysql database to store the search terms and such. Here is a great tutorial on this -
http://www.youtube.com/user/phpacade...51/6pW7mGr8oAU
There was one that used a javascript array and no database - It was called Tipue 4.2.
You have to define the searchable terms/text in the javascript file, which means a lot of manual text-keyword typing, but it does an OK job as far as flat files search engines go.
Here's the link: http://www.brothersoft.com/tipue-js-download-26404.html
(the server 2 or 3 download links are still live)
When I used it, I used the "Javascript" folder in the download pack and bypassed the RSS and XML folders.
"tipue_data.js" is the file where you define your search data.
The official website doesnt seem to exist anymore but as luck would have it, I copied and pasted the tutorial/setup pages into a Word doc at the end of 2007
See attached.
Hope that helps.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
madu (08-03-2010)
Thinking on - I used Tipue a few years ago in a college project and I just found the archived link again to my sample website - this provides a good example of how the search works and how it can be styled to fit in with your site. http://chesterfieldstudents.co.uk/ptfdsc/bev/
Just search on "Tapton" to produce a good amount of search results.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
Here's a spreadsheet that might help you to prepare and keep track of your search terms in Tipue (attached)
Dont edit the cells with red text, just the cells with black text.
Array numbers must be a new number per search item line, starting from 0 with no missing numbers (must be sequential)
No semi-colon on the very last line.
Once you've populated all your search data, you can highlight and copy all the data (from yellow cell to yellow cell) and paste it into the "tipue_data.js" file via Notepad.
Hope that helps.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
madu (08-03-2010)
There have already been a number of good answers, but here's a general response to your question: there is no easy way to create a good search engine. Either it will be good and very hard to make, or it will not be very functional. One of the easiest ways is to create a keyword list where you manually describe items and guess what people may search. This makes everything simpler, though it is still by no means "easy". The problem here is that it takes a lot of effort to maintain this system, and maybe one way you could make it easier is to skip the "search" and instead use a "tagging" system where you simply apply tags like "animal" or "books" to whatever items they apply. Any creative system like that will be easier and more effective than anything but a full search system which is complex.
It is possible to use a database like MySQL and do a full text search, but this is intense for the processor and may be slow, depending on the size of your site. You will certainly need to move away from html files and start using a database if you want to try this (in theory you could duplicate your content into the database and still have regular html files, but that seems unhelpful).
In conclusion, this is a particularly hard thing to write and I'm working on it myself. There are a few threads here in PHP and in MySQL about some of the algorithms I've worked out and while they work well, they are difficult to implement and not very efficient. After that, it's amazing how fast google and other real search engines can go through so many pages.
My recommendation if you really want something "easy" is to just use a google custom search. Many sites use it and it really is effective. The only problem is that it's google and not your page, so it may not look so "professional", but it's a great way to create a search and certainly the easiest, as long as you don't need to control it yourself (such as adding custom options). Now google custom search even allows some integration into the page such as styling, etc.
For an example, just look at the search here.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
wow....it's working nicely. thank you Beverleyh![]()
No problem madu.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
Bookmarks