Hi,
I am looking for a solution with PHP that will allow me to run a shared countdown timer.
Background on the project:
This application will be used as a timer that will show all particpanting client web viewers the time remaining for a bid that is in progress. Each viewer will be able to see a counter that counts down that is updated (say every 5 seconds) from the server so that all viewers counters will be synchronized (as close as is reasonably possible through the internet). If a bid is placed the timer resets and the 90 second countdown begins anew. If no bid is placed then the clock is allowed to countdown to 0. Unless the administrator pauses the countdown for some reason. Only the administrator would have control of the timer except if a viewer has placed a bid. By placing a bid the countdown resets to the max allowed time, in this example 90 seconds. The process would continue until no one has placed a bid in the last 90 seconds (in this example).
My current thinking is along these lines:
Have some sort of master timer (not sure how to do this) running on the server that will be used by viewers in multiple browsers to show the elapsed time of the event (in progress bid). Most likely timing would be 90 seconds to 0. This value would need to be modifiable by the administrator. Each viewers browser would need to show the countdown (use javascipt count down for the local display?) but be updated, say every five seconds, from the server (using meta refresh?). There would be an adiminstrator who will start, stop, pause, or reset the timer to new value. Each of the client viewers would then see on their web page a counter that was counting down (in real time) from say 90 seconds and if paused by the administrator would have there timer stop at the paused value after updating from the server.
Any ideas on how best to accomplish this? I am not asking for code (any offered would be appreciated) but with ideas how best to accomplish this.
Thanks in advance,
Ray