Unique Hit Counter

Results 1 to 6 of 6
  1. #1
    Banned Adriana is offline
    BannedRank
    Apr 2011 Join Date
    127Posts

    Unique Hit Counter

    As i sow a lot of sites use hit counter but they use the free ones that advertise for free on your website so i decided to release my script have fun with it and don't forget to give me some like(thanks)

    PHP Code:
    <?php

    $file 
    "/path/hits_database.txt";
    $ip_list file($file);
    $visitors count($ip_list);

    if (
    in_array($_SERVER['REMOTE_ADDR']."\n"$ip_list))
    {
        echo 
    "<b>Our Site Hits: </b>: $visitors <br>";
        
    fclose($fp);
    } else {
        
    $fp fopen($file,"a");
        
    fwrite($fp$_SERVER['REMOTE_ADDR']."\n");
        
    fclose($fp);
        
    $visitors++;
         echo 
    "<b>Our Site Hits: </b>: $visitors <br>";
    }
    ?>


  2. #2
    Genesis?Is it a new drug? renan7899 is offline
    MemberRank
    Apr 2010 Join Date
    BrazilLocation
    519Posts

    Re: Unique Hit Counter

    Well, the ones with advertise shows the country of the ppl that acess the website. '-' ... Anyway, I don't like to use that, but you have my thanks :P

  3. #3
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: Unique Hit Counter

    You could already google for this really lol, but.. i guess it might be useful to... someone. prehaps.

  4. #4
    Account Upgraded | Title Enabled! michel100 is offline
    MemberRank
    Oct 2010 Join Date
    The NetherlandsLocation
    208Posts

    Re: Unique Hit Counter

    Well a script like that is sort of well ... basic >.>

  5. #5
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    Re: Unique Hit Counter

    You could shorten -
    $file = "/path/hits_database.txt";
    $ip_list = file($file);
    $visitors = count($ip_list);

    to

    $Visitors = count(file("/path/hits_database.txt"));

    Keep it simple :)

  6. #6
    Supra Translator 88supra86 is offline
    MemberRank
    Feb 2011 Join Date
    CanadaLocation
    388Posts

    Re: Unique Hit Counter

    i dont use a hit counter i just see how many hits a page has and WOW the amount of ppl that have been to my download page yet i dont see them in the game....... sences leechers and stealers for content



Advertisement