logic for Counting url hits

Discussion in 'Programming' started by krishmk, May 4, 2009.

  1. #1
    I am trying to create a simple php script for counting hits on url listed in my website.


    a) Collect url + IP Address info
    b) If url and IP Address exists in database check the visit date
    c) If the visit date was within 24 hours - Do nothing (but just redirect the visitor to specific url)
    else add new entry in database + increment the value of counts for the specific url + redirect the visitor to specific url.

    HITS database fields
    id | ip_addr | count | url | visit_date

    Is this the correct logic? or do you think it requires some modification?
     
    krishmk, May 4, 2009 IP
  2. WoRLDLiFE

    WoRLDLiFE Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think that would be enough for the application your are trying to create ... I think you should go ahead and create it! Best of luck :)
     
    WoRLDLiFE, May 4, 2009 IP
  3. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    if you can make it a wordpress plug-in then lot of people will get benefit. And so do you. Oh ya you might get lot of traffic.
     
    alfa_375, May 4, 2009 IP