Results 1 to 5 of 5

Thread: page visiting code

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default page visiting code

    Hi
    I am making a web site that www.ask-photos.com with some script using from this site . I want to create a digital page visit counting each month or total

    Please help me
    by Somakumaran
    Last edited by jscheuer1; 07-10-2012 at 05:08 AM. Reason: Format

  2. #2
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Make an account with Google Analytics:

    www.google.com/analytics/

    Link that account to SeeTheStats:

    http://www.seethestats.com/

    Follow guide to put it all together:

    http://www.labnol.org/internet/displ...website/17707/

    GA is a very good way to optimise your traffic flow, the data it collects is surprisingly detailed. With SeeTheStats, you can then make that information public and share it on your site.

  3. #3
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Or if you want to go very low tech, you could use a very simple PHP hit counter and in each page you want to use it, all you have to do is reference it using include:
    Code:
    <?php
    include ("counter.php");
    ?>
    so the code within counter.php, will be:
    Code:
    <?php
    $count_my_page = ("hitcounter.txt");
    $hits = file($count_my_page);
    $hits[0] ++;
    $fp = fopen($count_my_page , "w");
    fputs($fp , "$hits[0]");
    fclose($fp);
    echo $hits[0];
    ?>
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  4. #4
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Another low-tech method is to use a CGI script. You can make a decent hit-counter at http://www.digits.com They walk you through it step by step (There's only five steps or so) and then just copy-paste to code they give where you want it to be displayed.

  5. #5
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Just as a side note, are you trying to count the hits for inividual users? Or for all the hits to the site? The only reason I ask is because this thread is in the javascript forum.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •