View Full Version : Real time hit counter
kwahamot
01-15-2008, 11:58 AM
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
-----
BLiZZaRD
01-15-2008, 01:47 PM
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 (http://www.kirupa.com/developer/mx/hitcounter.htm) it works fine with a refresh.
kwahamot
01-15-2008, 05:32 PM
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/generators/users_online.php
tom
-----
kwahamot
01-15-2008, 05:45 PM
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!
BLiZZaRD
01-15-2008, 07:03 PM
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.
BLiZZaRD
01-15-2008, 07:03 PM
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 ;)
kwahamot
01-16-2008, 02:50 AM
Thanks! Very cool.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.