Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

countdown timer/stopwatch

Status
Not open for further replies.

dinodigital

Technical User
Jun 24, 2007
9
AU
I am currently wanting to implement a php page, with a small countdown timer, specifically a timer that will countdown from either 40, 30 or 20 minutes (editable starting countdown time) that will countdown from that time to 0, and be able to reset itself with the click of a button. I have been checking php websites but haven't been able to find simple code to implement a countdown timer like this, only timers to measure time between page execution. I need the countdown timer to be large and easily visible and possibly have an alert/tone when it reaches zero.

Does anyone have any ideas of the best way to implement this?

I've also been wondering the best way to implement a scoring type system. I need to be able to enter number values into a form, hit a submit button, then display those numbers to the user. The user would be continually entering in new values, and at a point in time, I need to be able to sort the scores from highest to lowest, take the two highest scores and work out the total.

I'm very new to php which is why I'm having trouble with displaying and coding this in realtime and continually updating the page to show the new values added and the countdown timer in real time.

Any help is appreciated....thanks in advance
 
PHP is fully executed by the time it delivers the HTML page you're looking at. Meaning that as soon as the page is displayed, any PHP script has finished working already. Since it looks like you want to have this timer on the page after it's been loaded, you will have to look into client-side technologies (forum216). In case you actually want to have a server side counter, you would have to store the time somewhere on a server and reload the page every now and then to check how much time is left.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top