General discussion

Locked

Find The word in page

By eb_alavi ·
Hi,
I write a Search Engine with Asp.
My database is created by Access .
When I show result in page I want find the word
in page.
I mean for example user type "Goal"
And results show in page ,
Find any goal in page and write it with another color (Like Yahoo and Google ,They Bold word)


Thanks

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Find The word in page

by MadestroITSolutions In reply to Find The word in page

This is very simple to achieve:
I can almost bet you are using an ADO recordset to retrieve the data. In any event, what you do is replace all occurrences of the word within the text with a color-formatted version. for Example, lets say user searches for "Goal"....
Once you retrieve the information from the database, you would do something like this

' Assuming you have a recordset named RS and
' your keyword is stored in variable KEY

FKEY = "<FONT COLOR='blue' STYLE='background-color:#ffffcc;'>" & KEY & "</FONT>"
Data1 = RS.fields(1)
Data1 = replace(Data1, KEY, FKEY)
response.write Data1

Hope that helps, it you have any questions, write me an e-mail at webmaster@KingsDistributors.com

Good luck!

Collapse -

Find The word in page

by eb_alavi In reply to Find The word in page

Poster rated this answer

Collapse -

Find The word in page

by MadestroITSolutions In reply to Find The word in page

May I ask why have you rejected my answer? I just want to know out of curiosity, since I know that my answer works for a fact, because I use it myself, I am a webmaster. Thanks.

Collapse -

Find The word in page

by eb_alavi In reply to Find The word in page

Hi,
Your answer Help me .
Thanks you. Please excuse me for reject your answer, I know it now.

Good Luck

Collapse -

Find The word in page

by eb_alavi In reply to Find The word in page

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Software Forums