Jump to content

search function


jorley

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.