Reputation: 1
How can I make a countdown timer in PHP which starts at 40 seconds and counts in this format:
40.59 - 40.48 - 40.47 - etc etc
I also need a button that resets it.
Is this possible in PHP? Do I need to use JavaScript?
Upvotes: 0
Views: 1405
Reputation: 179046
PHP is executed server side; You'll need to use JavaScript or some other client-side language (flash, silverlight, java applet, etc) if you want it displayed to a user in real-time.
Upvotes: 1
Reputation: 95880
You will need JavaScript to achieve a timer.
Some useful resources:
http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/
http://www.dynamicdrive.com/forums/showthread.php?t=61593
http://www.devshed.com/c/a/JavaScript/Using-Timers-in-JavaScript/
Upvotes: 3
Reputation: 175748
You would do this entirely on the client side using Java*script*, there are many examples if you google for javascript countdown, ex http://keith-wood.name/countdown.html.
Upvotes: 2