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? Link to comment https://forums.phpfreaks.com/topic/225560-count-down-function/ 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. Link to comment https://forums.phpfreaks.com/topic/225560-count-down-function/#findComment-1164696 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 Link to comment https://forums.phpfreaks.com/topic/225560-count-down-function/#findComment-1164701 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. Link to comment https://forums.phpfreaks.com/topic/225560-count-down-function/#findComment-1164710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.