Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.