Link to home
Start Free TrialLog in
Avatar of NorthDorsetWeb
NorthDorsetWeb

asked on

Hit Counter not working

I have been using a hit counter for a few years on a particular site.  its maintained by a third party.

All of a sudden it doesnt seem to be working it shoudl be at 10,443 - it was working up until 9,000.

I have tried to contact Stats Machine without success - is this something within my code?  

If this is a problem at their end does anyone have an alternative solution whereby I can start the code at what should be the current count?  Preferably free or a tutorial.

Thanks.

I would be grateful for some assistance.  Here is the code:
In the head:
<script src="http://www.statsmachine.com/cgi-bin/counter.cgi?558|55838" type="text/JavaScript"></script>

In the body:
<a href="http://www.statsmachine.com/"><script type="text/javascript"><!--
mycount = mycount + 1;
var ooooooo = Math.floor((mycount)/1000000);
mycount = (mycount-(ooooooo*1000000));
var oooooo = Math.floor((mycount)/100000);
mycount = (mycount-(oooooo*100000));
var ooooo = Math.floor((mycount)/10000);
mycount = (mycount-(ooooo*10000));
var oooo = Math.floor((mycount)/1000);
mycount = (mycount-(oooo*1000));
var ooo = Math.floor((mycount)/100);
mycount = (mycount-(ooo*100));
var oo = Math.floor((mycount)/10);
mycount = (mycount-(oo*10));
var o = mycount;
document.write("<img border=0 src=" + ooooooo + ".gif><img border=0 src=" + oooooo + ".gif><img border=0 src=" + ooooo + ".gif><img border=0 src=" + oooo + ".gif><img border=0 src=" + ooo + ".gif><img border=0 src=" + oo + ".gif><img border=0 src=" + o + ".gif>");
// --></script>
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

This proves that your digit split works and that counter is failing:

<script>

mycount = 10443;
var ooooooo = Math.floor((mycount)/1000000);
mycount = (mycount-(ooooooo*1000000));
var oooooo = Math.floor((mycount)/100000);
mycount = (mycount-(oooooo*100000));
var ooooo = Math.floor((mycount)/10000);
mycount = (mycount-(ooooo*10000));
var oooo = Math.floor((mycount)/1000);
mycount = (mycount-(oooo*1000));
var ooo = Math.floor((mycount)/100);
mycount = (mycount-(ooo*100));
var oo = Math.floor((mycount)/10);
mycount = (mycount-(oo*10));
var o = mycount;
document.write(ooooooo + "  " +oooooo + "  " +ooooo + "  " +oooo + "  " +ooo + "  " +oo + "  " +o );
// -->
</script>


By the way, I see the counter at the moment at: 446

Avatar of NorthDorsetWeb
NorthDorsetWeb

ASKER

Hi there thanks for your response.  So unless I manage to get hold of them then theres little i can do.

Can you offer an alternative solution?

Many thanks
Emma
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Brilliant - that's done the trick.

For future reference, and it doesnt appear that the statsmachine.com provides the same service anymore, do you know of any good third party counters?  That are free - or can you create them by writing script yourself?  
I do not use any free counters and I cannot imagine one doing it in JavaScript.
But it is easy to write one on web server side. Do you have PHP or ASP on server side?
We have asp
Thanks for all of your help.  Kind regards emma
You are welcome.