I’m trying to create a basic version of survivor(the game show) type site that I want to create/finish sometime , and I want a function to show how much time they have(that is active/always changing with no refresh) left to vote/participate in the challenge(s) and then right after that hits 0, I want another function(a break of n time) to make sure everything worked and, then start another function that lasts for n amount of time.
What is the easiest way of doing this, is there a tutorial I can look at to better understand how to do these types of things?
well you are going to need to store the start and end times in the database, then use php to get the time variable to javascript which will show a simulated clock counting down. I say simulated because it is not actually serving any purpose other than to show the user some sort of time counting down the really time is kept by the server and the real time gets sent to javascript when the user comes to the page and that is what tells the javascript where to countdown from. It is not just simple timer thing that is gonna be some work!!!then you would also have to add in a function that when it hits 0 timeout(3000) (3 seconds) restart counter from beginning.
there is an article that has everything you need, it is for an auction but the same concept as far as the timers go:
http://www.phpbuilder.com/board/showthread.php?t=10378693
check out johanafm’s response