Count Banner Clicks?

Discussion in 'Programming' started by Karabaja, Mar 28, 2008.

  1. #1
    Could someone please point me to simplest solution to count clicks on a banner. I've added a sponsor banner and I'd like to have an idea about how much people are clicking on them.
    But I wouldn't want to bother installing something like openads, as it is not that important for me.
    So I was hoping there was some easier solution to count clicks on image banner.
    Any help would be appreciated.
     
    Karabaja, Mar 28, 2008 IP
  2. Yuffles

    Yuffles Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This PHP file will add to a log file simple and easy and then redirect the user.
    Make sure you have the directory containing the log file chmodded.
    
    <?php
    header('Location:http://www.changeme.com');
    $count_my_page = ("hits/banner.txt");
    $hits = file($count_my_page);
    $hits[0] ++;
    $fp = fopen($count_my_page , "w");
    fputs($fp , "$hits[0]");
    fclose($fp);
    ?>
    
    PHP:
     
    Yuffles, Mar 29, 2008 IP