Jump to content

Archived

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

nick1

Search Engine for Website

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

Share this post


Link to post
Share on other sites
You could parase your HTML files and compair the read words. I do think there is a function to compair similair strings, I just can't remember it.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.