• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

How do i create a custom search in PHP?

Ok I'm creating a website with PHP. I've created a text field to allow the user search for any content on the website at the index page, and I want the result displayed in another page called ".../search.php" how do I go about that?
0
tiimonie
Asked:
tiimonie
  • 3
  • 2
1 Solution
 
Lukasz ChmielewskiCommented:
Assuming you have your content in the database, just create a form - submitting it will search the database and show the results. Use post or get method in a form, to have the target page displayed with search.php?search=something.

Or not ? You have to be more specific.
0
 
tiimonieAuthor Commented:
Nah... I dont want to search the database because most content are on the website 'as-is'. How do i create a custom search on my website? A simple one is used here on EE at the top header - where you perform a search on this website.
0
 
Lukasz ChmielewskiCommented:
I think ( I know)  the site content is definetely stored in a database: the search is not made within the text files (html) but in the db. Search the database - see the full-text search / other topics related.
Read about the database storing - mysql, mssql.
0
 
Lukasz ChmielewskiCommented:
One more word. Most of the content as-is is not as-is :). This is just the product of the data retrieval from the mysql(?) database. This is what you should focus on.
0
 
tiimonieAuthor Commented:
About 'As-is', you are probably right, I mean there's no true way to identify how its been retrieved to the user any way. Thanks! I already have a MySQL database, would consider storing in the DB instead then.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now