General discussion

  • Creator
    Topic
  • #2333261

    Find The word in page

    Locked

    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

All Comments

  • Author
    Replies
    • #3594997

      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 = “” & KEY & “
      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!

    • #3604215

      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.

      • #3506170

        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

    • #3506169

      Find The word in page

      by eb_alavi ·

      In reply to Find The word in page

      This question was closed by the author

Viewing 2 reply threads