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 Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/ 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. Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029653 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 Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029657 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 Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029660 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 Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029665 Share on other sites More sharing options...
darkfreaks Posted March 21, 2010 Share Posted March 21, 2010 or you could use a cron job Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029668 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"? Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029669 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 Link to comment https://forums.phpfreaks.com/topic/196027-page-visual-count-down-timer-once-the-timer-is-up-runs-a-script/#findComment-1029670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.