Similar posts

Discussion in 'PHP' started by login, Oct 9, 2008.

  1. #1
    I have a web site that gets the pages from a db. How can I show a link list of pages that have similar title on each page of the site?

    Thanks. Green rep to good answers :)
     
    login, Oct 9, 2008 IP
  2. mallorcahp

    mallorcahp Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Take the title of the page you are on, strip out common words like:

    if, and, where, when, why, the, in, or ... etc etc

    with the remaining words, count the number of entries in the database that have that word in the title

    presumably, the higher the count, the more relevant as in, that word is the most relevant as it has the most other entries ... (could maybe link this with other relevancy indicators such as number of times viewed ...)

    list each db entry with that word in the title and create a link to it ...
     
    mallorcahp, Oct 9, 2008 IP
    login likes this.
  3. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Thanks mallorcahp :)

    I forgot to say that links have to be automatic listed, the site has 5000 pages.
     
    login, Oct 9, 2008 IP
  4. Sillysoft

    Sillysoft Active Member

    Messages:
    177
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Sillysoft, Oct 9, 2008 IP