473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

implementing a website search feature using php

i want to implement a feature where a user searches with a keyword and search results are displayed according to the keyword

or phrase entered by the user.

following are the steps i want to follow. please advice if i am missing out any steps or i can add any step.

1. read the keyword entered by user using $search = $_POST["searchkeyword"];

2. read all the files from the root directory into a variable (as all files will be saved in the root directory)

3. from step 2 filter and read only files with html and php extensions into a variable

4. read the entire contents of all html and php files into a variable

5. compare $search with all the individual html and php file contents from step 4

6. if a match is found with either html or php file then display a brief title and brief description which will be a link to

the actual file which has the keyword.

7. display search results in a serial order as 1. Brief Title of the page 2. Brief Title of the page ...

8. at the bottom of the page based on the total number of results found from step 6 i would like to provide a link to page 1
page 2 page3 ... (i can decide to display only 10 results per page)

please advice.

any help will be greatly appreciated.

thanks.
Jul 16 '08 #1
1 1469
pbmods
5,821 Expert 4TB
Heya, Runway.

Consider using grep (http://en.wikipedia.org/wiki/Grep).
Jul 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Troels F. Smit | last post by:
Where can I find information on implementing a search function on my site ? -- Mvh. Troels F. Smit
1
by: Brian Quigley | last post by:
Hi, i have a website built in asp and access (to be upscaled to SQL server). i need to put in a website search engine. Anyone got any ideas on an easy to integrate commercial one ? my worry is...
1
by: Casey | last post by:
Hi, How would one allow for possible multiple search criteria using FREETEXTTABLE. For example, my table "listings" has a full-text search catalog, and I may want to: SELECT * FROM listings...
0
by: sresh | last post by:
Hi All,, I want to create a Website in IIS using WMI through VB.NET programmatically..if anyone knew please help me..otherwise anyone can tell atleast which classes we have to use in VB.Net for...
4
by: NC | last post by:
On Jul 16, 10:51 am, Sudhakar <sudhakarar...@gmail.comwrote: Use an off-the-shelf search engine... I've used Sphider on a couple of occasions: http://www.sphider.eu/ Cheers, NC
1
by: vickygoelk | last post by:
Hey my question is how we disable the firefox drag feature using javascripts?. if it possible then please solve this problem. Thanks, vivek Kumar
2
by: ssubbarayan | last post by:
Dear all, I am in the process of implementing pageup/pagedown feature in our consumer electronics project.The idea is to provide feature to the customers to that similar to viewing a single sms...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.