473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

highlighting search term results

I've seen previous threads but I still need help in highlighting
search terms like google does on their search result page.

I know I need, ob_start();
Then I process to highlight the search term hits, then I flush the
buffer to render the page.

I'm comfortable with PHP coding but what I need is simple step by step
help, with a simple search form example.
The explanations I see are either way to lofty or too small a piece of
the "puzzle".

Thanks,
Lee G.
Jul 17 '05 #1
2 2350
leegold2 wrote:
I know I need, ob_start();
Then I process to highlight the search term hits, then I flush the
buffer to render the page.

Actually, when preforming local (database) searches, you don't. It all
comes down to highlight the appropriate pieces of text.
I'm comfortable with PHP coding but what I need is simple step by step
help, with a simple search form example.
The explanations I see are either way to lofty or too small a piece of
the "puzzle".


Then, explain in more detail what the requirements are. If you want to do it
like Google, you don't have to worry about tags, because Google indexes text
fragments only.

On the other hand, when there are html tags in text matches, the following
snippet I posted a while ago might be of interest to you:

http://www.jwscripts.com/playground/highlight.phps

I have also an example which applies a search on the file system (warning:
str_ireplace() is supported in PHP version >= 5):

http://www.jwscripts.com/playground/search-eng.phps
HTH;
JW

Jul 17 '05 #2
On Sun, 24 Oct 2004 16:54:42 GMT, leegold2 <le*****@nospam.net> wrote:
I've seen previous threads but I still need help in highlighting
search terms like google does on their search result page.

I know I need, ob_start();
Then I process to highlight the search term hits, then I flush the
buffer to render the page.

I'm comfortable with PHP coding but what I need is simple step by step
help, with a simple search form example.
The explanations I see are either way to lofty or too small a piece of
the "puzzle".


http://www.alistapart.com/articles/searchhighlight/

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
14
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like...
3
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been...
1
by: Sheau Wei | last post by:
Below is my search engine code. I realize that the function was very limitied because i cannot searching the "NamaPealatan"(name of tools) compatible to the either categories Operasi or Balai or...
3
by: Sheau Wei | last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code? Thanks <Table cellspacing=1 cellPadding=1...
1
by: cglewis03 | last post by:
Hello, I am trying to build a search form with several different options to choose from. Currently it is set up to open within the same window if a single option is selected and open within a...
10
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
3
by: Bigalan | last post by:
Hello, i am relatively new to PHP and i am struggling with printing multiple search results on to different pages. The code below works ok but when you click on next page button, it brings up a blank...
0
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,...
0
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...
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...
1
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...
1
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...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.