jordz Posted March 21, 2010 Share Posted March 21, 2010 How would i go about creating an on page count down timer that would count down from say 10minutes and once the timer hits 0 it runs another part of the script? Thanks, Jordan Quote Link to comment Share on other sites More sharing options...
devofash Posted March 21, 2010 Share Posted March 21, 2010 Use client-side javascript to countdown and then redirect to a php script once the timer is up. Quote Link to comment Share on other sites More sharing options...
inversesoft123 Posted March 21, 2010 Share Posted March 21, 2010 http://php.net/manual/en/function.sleep.php Quote Link to comment Share on other sites More sharing options...
ldb358 Posted March 21, 2010 Share Posted March 21, 2010 you could also send an ajax request after the timer is up Quote Link to comment Share on other sites More sharing options...
jordz Posted March 21, 2010 Author Share Posted March 21, 2010 How would I go about doing this then? The idea of this, When I open a page it sets a MYSQL field to "1" if the counter times out (after 10 minutes) it sets the mysql to "0", the timer needs to be able to be used while this page is opened by multiple people but count down 10 minutes for each of them? ie. user 1 opens the page at 14:00 and times out at 14:10 while user 2 opens at 14:04 and times out at 14:14. Do you see where I'm going with this? I've heard ajax is a good option to take but I would I go about that with ajax? Jordan Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 21, 2010 Share Posted March 21, 2010 or you could use a cron job Quote Link to comment Share on other sites More sharing options...
jordz Posted March 21, 2010 Author Share Posted March 21, 2010 or you could use a cron job a "cron job"? Quote Link to comment Share on other sites More sharing options...
inversesoft123 Posted March 21, 2010 Share Posted March 21, 2010 http://www.aota.net/Script_Installation_Tips/cronhelp.php3 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.