Counter

Discussion in 'PHP' started by Zidu, Oct 31, 2008.

  1. #1
    I'm looking for a counter that will act in a similar manner:
    http://www.nationalpriorities.org/
    (on the right side at the bottom “Cost of the war in Iraq”)
    I have only java script:
    <div id="counting">1</div>
    <script type="text/javascript">var n=1;
    function plusfigure (n){
        document.getElementById("counting").innerHTML=n;
        n++;
        setTimeout("plusfigure ("+n+")",500);
    }
    plusfigure (n);
    </script>
    
    Code (markup):
    This script is not resistant to refresh.
    Someone could help me?
    Ps.
    Sorry for my english.
     
    Zidu, Oct 31, 2008 IP
  2. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #2
    I think javascript alone can't do this. You might need to store it to database or something
     
    ads2help, Oct 31, 2008 IP
  3. Zidu

    Zidu Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, I know that's impossible in the javascript, needed database. Therefore looking for help in php.
     
    Zidu, Oct 31, 2008 IP