how to make a count up timer that shows same number for everyone for php/html

I found a website that has a counter and it just keeps counting and shows the same number for everyone. Some how the number is being stored. can someone help me recreate this count up timer in php or html. Thanks. Heres the site i was referring to "http://addmefast.com"

Answers


The website you reference uses the flipCounter Jquery Plugin:

http://bloggingsquared.com/jquery/flipcounter/

Perhaps you can take a look at it and come back with more specific questions.


I visited addmefast.com with two browser windows open and the counters were different. So the number actually isn't the same for two people...at least it probably isn't safe to assume so.

If you examine the source code at

http://addmefast.com/flipCounter/counter.php

You will see the javascript used for refreshing the count. You will also see that they make an ajax call every 60 seconds to sync the counter.

var refreshId = setInterval(function(){
    var jqxhr = $.get("getstats.php", function(result) {
        showcountercount(result,50000);
      });
}, 60000);

The are using the flipCounter jquery plugin to manage all of this.

The php back-end is trivial: simply store a date somewhere in the system and pass that date to your counter.


This code may help you:

I think the following code will help you. 1) Set the variable name ID 2) Then set the interval for it as shown in the function

var refreshId = setInterval(function(){
var jqxhr = $.get("getstats.php", function(result) {
    showcountercount(result,50000);
  });

}, 60000);

// set the counter value


Need Your Help

Several appdomains calling the same unmanaged dll

c# .net dll appdomain

Our .NET 3.5 C# application creates multiple appdomains. Each appdomain loads the same unmanaged 3rd party dll. This dll reads a configuration file upon initialization. If the configuration changes

Sortable table with Bootstrap and JSON data

json twitter-bootstrap sorting datatables html-table

I am reading JSON data with jQuery and then I want to show them in sortable table using Bootstrap. My problem is that Bootstrap does not see my JSON data. They are showing in table, but when I want...