jushiro Posted October 21, 2011 Share Posted October 21, 2011 Can anyone help me to make a countdown timer in php? so basically i've made a quiz.. but i want it to have a time of 1 hour 30 mins.. but i dont have any idea of how to make a timer Quote Link to comment https://forums.phpfreaks.com/topic/249504-countdown-timer/ Share on other sites More sharing options...
watsmyname Posted October 21, 2011 Share Posted October 21, 2011 if you make with PHP you need to refresh or use ajax to update the timer, why don't you use javascript instead?? Quote Link to comment https://forums.phpfreaks.com/topic/249504-countdown-timer/#findComment-1281042 Share on other sites More sharing options...
xyph Posted October 21, 2011 Share Posted October 21, 2011 JavaScript can be fooled. Use JavaScript to show the user real-time how much time they have left. Start the test by storing time or similar timestamp in a database. At the end of the test, check if time() - 60*60*1.5 ( 60 seconds * 60 minutes * 1.5 hours ) is less than or equal to the original value you stored. If its greater, more than 1.5 hours has elapsed since the first timestamp was stored. Quote Link to comment https://forums.phpfreaks.com/topic/249504-countdown-timer/#findComment-1281044 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.