Make a Tag Cloud

Discussion in 'PHP' started by Righey, Jan 31, 2010.

  1. #1
    Hey guys, I've been searching for a while now, but I can't seem to find what I'm looking for.

    I want a simple php script (that can interact with a MySQL DB if needs be) that takes the most poplar words/terms entered into a search bar that I have on my site (which searches google) and displays them in a "tag cloud", which I can customise with CSS. When you click the term in the tag cloud, it searches what you clicked in my search bar.

    Is this possible?
     
    Righey, Jan 31, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    What i'd do is make the search using $_GET - search.php?term=$searchterm

    Then link the tagcloud values to your search so it would be like search.php?term=$tagcloudvalue

    And for the tagcloud, connect to your sql and do a query extracting what you want the tagcloud to display then do a foreach() loop.

    You can then style it using divs & css.

    Edit: Here's an example.
     
    danx10, Jan 31, 2010 IP
  3. Righey

    Righey Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I'll let you know how it goes.
     
    Righey, Jan 31, 2010 IP