Jump to content

Search Engine for Website


nick1

Recommended Posts

Greetings,

Well, as the subject of this thread says. I'm wanting to create an
option on my website that allows visitors to search the entire site for
the phrase they enter into a form. Clicking the submit button will fire
off the search and return links to pages that contain their search phrase.

Do you know of a way to create this using just HTML or PHP? I'd prefer
not to use a MySQL database or some third party software/script. I'd like to write my own script and keep it simple as possible. Any advice would be greatly appreciated.

Thank you for your time,

Nick
Link to comment
https://forums.phpfreaks.com/topic/8283-search-engine-for-website/
Share on other sites

I am not an expert but I think that a way to do it would be has follow :
in a loop for each html file :
[blockquote]You do a fopen of your html file
You do a read in one variable
You search your string in that variable
If your string exits, you put the name of the file in a array
[/blockquote]You display your array as result

The problem is that you have nothing to follow the link in a page so you if you have only html pages it should work. No dynamic call of include for exemple.

God luck

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.