Fenhopi Posted January 24, 2011 Share Posted January 24, 2011 Hi, I want the user to be able to go to one page and hit a button, once he hits the butten I want a count down to start from 10 minutes. When the user goes to the page within those 10 minutes, I want it to show him a live countdown until those ten minutes run out. Any ideas how I would go about doing this? Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 24, 2011 Share Posted January 24, 2011 Query MySQL table to update the end time and use Javascript to show a live countdown by using time() - $stored_time and you could convert the seconds to hours/minutes/seconds. Quote Link to comment Share on other sites More sharing options...
Fenhopi Posted January 24, 2011 Author Share Posted January 24, 2011 Thank you! Any advice how I would do this part? Query MySQL table to update the end time Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 24, 2011 Share Posted January 24, 2011 $new_time = time() + (10 * 60); $update = mysql_query("UPDATE `table` SET `column` = '$new_time' LIMIT 1;"); Given it's the only thing in that table, and it already exists. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.