"Psythor" wrote:
leegold2 <le*****@nospam.net> wrote in message
news:<G3kbd.823$WO1.510@trnddc03>... leegold2 wrote:
Commonly done, eg. you enter a word in a search engine and when a hit-page comes up the search word(s) are highlighted.
I’m doing a fulltext search that works well but I’ve tried a few "packaged scripts" and haven’t got one to work yet. I’m looking for straightforward understandable way to do this on my MYSQL/PHP pages.
Thanks,
Lee
To Add: Just to make clear i’m looking for something I can
add to my existing PHP code that does the mysql fulltext search - all works
fine. I want to *add* the hiliting feature. Thanks
If you pass the search term to the page in the url, you could then
use str_replace to replace all instances of the search term. For
example:
$output = str_replace($_GET[searchterm],"<font
color=red>".$_GET[searchterm]."</font>",$output);
I’d imagine this’d take up quite a bit of power and take a
while to do
on big pages.
This is exactly how phpbb works. Go to phpbb.com, go to forums, and
search for a term. You will see the term carried in the Query String,
and it is highlighted in the text. Actually php is very fast, and I
would not worry about performance --- takes a lot more resources to
load huge text index, than highlight a few words --at least 1000 to 1
in difference.
Come to think of it, download phpbb, and see how they do it.
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbForumz.com/PHP-highligh...ict160305.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=539437