Advanced Search

Results 1 to 7 of 7

Thread: Real time hit counter

  1. #1
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Real time hit counter

    Hi,

    I want to make a real time, automatically updating, graphical hit counter to display in pages on my web sites. Something that doesn't require a page refresh. I've seen these in Flash format, but haven't found a tutorial on how to build one, or a .swf file I could download and modify myself.

    Any tips or pointers would be appreciated.

    tom
    -----

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, without a page refresh you aren't sending data to the Flash anymore. Once the page is loaded it is pretty much done. You can do a persistent connection to a database or such but most web hosts and server hosts don't allow this as it causes problems on the server.

    The hit count would have to be stored somewhere, usually a .txt file. That file has to be opened, written to, read from and closed each time that page is loaded. Another server pain. For Flash to do that it has to use php, and a CHMOD on the txt file of 777. Again 777 is something most servers and hosts don't allow.

    There are ways to "fake" it, but for a general hit counter it works fine with a refresh.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Blizzard,

    Here's the one I found which seems to work without a page refresh, but it's hard to tell for sure. It was designed for myspace profiles.

    http://web1.modmyprofile.com/generat...ers_online.php

    tom
    -----

  4. #4
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The Syko tutorial pointer you gave me is almost a live counter. It looks like it can be set up to periodically refresh only the flash graphic rather than the whole page, via looping. Cool!

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    No, it is still refreshing the page, just automatically. Probably using a php refresh method.

    You could accomplish the same thing with a regular counter and a meta tag refresh. If you don't want the page to look like it's refreshing (as they have done here) put the counter in an iframe, or a frames set.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by kwahamot View Post
    The Syko tutorial pointer you gave me is almost a live counter. It looks like it can be set up to periodically refresh only the flash graphic rather than the whole page, via looping. Cool!
    Any counter can. as mentioned in my above post
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #7
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! Very cool.

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
  •