473,795 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

implementing a website search feature using php

54 New Member
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["searchkeyw ord"];

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 1489
pbmods
5,821 Recognized Expert Expert
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
1897
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
1322
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 that the pages will work with the search engine. The pages are formed as follows.... <include header.asp> var page page = home_page
1
8175
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 WHERE name LIKE @name AND city LIKE @city I've got it working to select only by name: SELECT listing_id, RANK, name, address, city, zip, heading, phone FROM listings a,
0
1536
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 crating Website So please anyone give any suggestions to me Thanking U all Suresh
4
1560
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
1788
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
2859
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 message in a mobile device.With in the given view area if the whole message does not fit,we need to provide the ability for users to scroll through the entire message using pageup/pagedown or key up and key down.In our case we have the whole...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.