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
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

Link to comment
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.