jorley Posted February 22, 2010 Share Posted February 22, 2010 Hey guys, I am trying to create a search function to search all the copy on a site. The copy consists of FAQs, about us, terms, ect.. All the copy is stored in a database table called copy. I did this so the owner can edit it through an editor to make changes. I am trying to find a way to search through the newest version of each page for whatever the user puts in for a search term. This could be 1 work or a couple word phrase. The challenge I face is how do I display it. Say they search for 'privacy' how do I take the return from each page and display it on one page? Is this the best way to do it or should I have a separate search for each page? Thoughts? Link to comment https://forums.phpfreaks.com/topic/192979-search-function/ Share on other sites More sharing options...
Psycho Posted February 22, 2010 Share Posted February 22, 2010 Not quite clear what you are asking. I would expect that the search results would include links back to the pages with the matched words. If it were me I would do something scuh as a title for the page followed by an exerpt of the text with the found word. The title would be a link tothe page: Title of first matched page ... something something something word something something ... Title of second matched page ... something word something something something something ... Link to comment https://forums.phpfreaks.com/topic/192979-search-function/#findComment-1016336 Share on other sites More sharing options...
jorley Posted February 22, 2010 Author Share Posted February 22, 2010 Thats what I was thinking of doing. I could list the title of each page and then when they click it to go to the page maybe create a function that highlights the background in yellow everytime that word or phrase exists. Link to comment https://forums.phpfreaks.com/topic/192979-search-function/#findComment-1016339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.