<xmp> <meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> <meta name='google-adsense-platform-domain' content='blogspot.com'/> <!-- data-ad-client=ca-pub-9252412571485847 --> <!-- --><style type="text/css">@import url(https://www.blogger.com/static/v1/v-css/navbar/3334278262-classic.css); div.b-mobile {display:none;} </style> </head><body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d6237629\x26blogName\x3dSkai+Chan+Kai+Lun\x27s+Blog+%5Bsillydumb.c...\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://sillydumb.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://sillydumb.blogspot.com/\x26vt\x3d-900517007015619153', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </script> </xmp>

Sitemap / Terms of Use / Music / Useful Links / Contact Me


Tagboard
Trying to find time to script it myself.
My Sites
My Friends
Latest Entries

Subscribe to
Posts [Atom]


HOME > MY BLOG >



Saturday, December 30, 2006


About Online User Counter

If you have been wondering about how online user counters work, I would share my five cents worth of knowledge.

It detects the number of users online by tracking their IP addresses. Each IP address will be stored for an amount of time, unless the visitor triggers the script again and the counter restarts. At the same time, the script will count for the number of IP addresses stored to determine the number of users “online”.

A problem arouses when multiple IP addresses are detected from a visitor and the number of count exceeds the correct amount. This is the reason why a few months ago, sometimes you can see the number of my website’s online visitors reaching more than twenty.

For most free online scripts hosted by free service providers, they store each visiting IP address for fifteen minutes; however, in order to save bandwidth, they do not provide auto refreshing. A regular visitor will not stay in a blog for more than five minutes and thus the storing of IP addresses for fifteen minutes will be very inaccurate, on the other hand, will be very flattering for the owner.

The greatest problem about free service providers is that when their bandwidth has reached the limit or their server is down, the browser will take some time to try and load the script before it gives up, such that, visitors might think it is the problem with your website and give up waiting.

In order to solve the problems of inaccuracy, especially for the multiple IP addresses problem, I have implemented a free online PHP script in my webhost, which is adjustable. Since I have limited each storing of IP address to be only five seconds and with its auto-refresh function, the inaccuracy counted by time is at most five seconds.

For my website, it is displayed as “X readers online”.

Labels: ,


... Skai (Kailun) dreams @ 12:17 AM

0 Encouragements:




Sweeten my dreams (0)

<< Latest Entries




 

v. Dear Dreams. Copyright © 2001-2008 Skai Chan. All rights reserved.
Go to Top ^


Fight Spam! Click Here! Top Personal blogs Personal blogs