Track clicks on links to other websites?

Discussion in 'PHP' started by mokimofiki, Jun 9, 2009.

  1. #1
    I have links on my website that I need to keep track of how many times they are clicked and would like to save the clicks to my mySQL database for example:

    <a href=\"http://www.topmmorpgsites.com\" target=\"_blank\">Top MMORPG Sites</a> is a link on the site.

    When it is clicked I would like the database to update from 350 clicks to 351.

    Any thoughts?
     
    mokimofiki, Jun 9, 2009 IP
  2. givemeknol

    givemeknol Active Member

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #2
    Create a table include some columns:
    SiteId, Url, ClickCount
    Render link as: <a href="click.php?site=<? echo SiteId ?>"><?php echo Url ?></a>
    In page click.php, increase ClickCount.
     
    givemeknol, Jun 9, 2009 IP
  3. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    perfect and easy thx
     
    mokimofiki, Jun 9, 2009 IP