Possible Improvement to PhpHitCounter
Brought to you by:
pjtpj
Hi PhpHitCounter Dude
from info@joegrist.com
I installed it and it didn't work. Traced the problem
to some extra whitespace in the dat file. PHP was not
interpreting the second number in the dat file as a
number, coz it had trailing white junk.
I modified the script as per below to make it safer and
thought you might want to know, incase you agree its a
problem and want to update your script.
Cheers
-----------------------------------
if(isset($counters[0])) $hits = $counters[0];
if(isset($counters[1])) $visits = $counters[1];
becomes
if(isset($counters[0])) $hits = trim($counters[0]);
if(isset($counters[1])) $visits = trim($counters[1]);