I had a website of 75 html pages Now I need to add a search into my index page. I wish to done it in PHP because my web server supports PHP. Please help me....

Thanks in Advance
Rajeesh

Recommended Answers

All 4 Replies

I would look into something like Google's Site Search.

Much easier than creating a script to search all those static pages.

I would look into something like Google's Site Search.

Much easier than creating a script to search all those static pages.

But my client need a custom search by our own..... Please help me.....

Well, in that case, you would probably need to use the file system functions to find and load each file.
(Check out the glob() and file_get_contents() functions)

Once you have the files loaded, you would have to search through them using either the String Functions or a Regular Expression.
(See the substr_count() and preg_match_all() functions.)

Then you could simply print a list of files that contained a match for your keywords.
You could count the matches per file and display them based on that to get a more ordered list.

Well, in that case, you would probably need to use the file system functions to find and load each file.
(Check out the glob() and file_get_contents() functions)

Once you have the files loaded, you would have to search through them using either the String Functions or a Regular Expression.
(See the substr_count() and preg_match_all() functions.)

Then you could simply print a list of files that contained a match for your keywords.
You could count the matches per file and display them based on that to get a more ordered list.

Is any example or tutorial available.... Please help me....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.