1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script to limit amount of hits/views per day?

Discussion in 'PHP & Perl' started by cheesecake, Aug 6, 2010.

  1. cheesecake

    cheesecake Regular Member

    Joined:
    Jan 12, 2009
    Messages:
    270
    Likes Received:
    229
    I know this requires mysql.

    I need this because I'm going to buy some junk traffic and I want to limit the traffic to exactly 200 UNIQUE hits a day. No more, no less.

    I have a script that will limit the amount of times a certain ip can view my site per day (dropping the table with cron once a day) but how do I make it to limit the total amount of hits?

    Basically:

    Limit total UV hits per day. Not counting double hits from same ip, etc...


    Any help guys?

    Thanks.
     
  2. hi.imandrew

    hi.imandrew Junior Member

    Joined:
    Nov 22, 2009
    Messages:
    159
    Likes Received:
    42
    Location:
    Arkansas, USA
    If your already tracking hits, just have a query something like "SELECT DISTINCT (ip) FROM table"
    if ammount of rows is > 200, die(); or however you want to do it.