[PHP] Countdown Timer
Posted: Thu Feb 14, 2013 10:15 pm
Hey guys, sorry for the oldtimes engine spam questions, i really want to make this one of the best engines for indie developers!
This time i come here saying that the building system is 100% done and fully operational, added some functions and stuff. Now i need to know, how can i make a easy to add countdown timer so it refreshes every second and when its done it does a refresh on the page.
I searched on google and found out this method:
http://stackoverflow.com/questions/1191 ... down-timer
But i cant seem to find a way to implement with the code.
The code im using is the time() function, and check if the time() >= $building_time //building time is the time when the build is finished.
So i want a function (the timer) to be able to get the difference between those two values and display a timer and countdown till 0, then i just need a refresh and the building system will do the rest.
Thanks for the help.
Whoever helps the dev of this engine gets a special spot in the credits, indie-resource.com is granted, but you can add your name to it.
This time i come here saying that the building system is 100% done and fully operational, added some functions and stuff. Now i need to know, how can i make a easy to add countdown timer so it refreshes every second and when its done it does a refresh on the page.
I searched on google and found out this method:
http://stackoverflow.com/questions/1191 ... down-timer
But i cant seem to find a way to implement with the code.
The code im using is the time() function, and check if the time() >= $building_time //building time is the time when the build is finished.
So i want a function (the timer) to be able to get the difference between those two values and display a timer and countdown till 0, then i just need a refresh and the building system will do the rest.
Thanks for the help.
Whoever helps the dev of this engine gets a special spot in the credits, indie-resource.com is granted, but you can add your name to it.