Jump to content

Recommended Posts

Hey guys,

 

I'm pretty sure this uses javascript, but I thought I'd post it in here as I have no knowledge of javascript and hoping there is some other way to do it.

 

I have a variable, this is set using the time() feature and is obviously a large number like 1203394304  I then add 5 minutes to it - time()+300;

 

and then minus the value, this gives a value in seconds of like 230 or something.

 

At the moment it displays:

 

You have 1 minute 23 Seconds until...

 

but this updates only when you refresh the page, I want the timer to auto count-down.  Does anyone know how to do that??

 

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/108269-countdown-timer/
Share on other sites

You are right.  You need Javascript to do this.  Or you can use some html code to auto-refresh it to get an update, but that's not really the same...php is a server side language. Everything is parsed on the server and then sent to the client.  Once it's done, that's the end of that, as far as php is concerned.

Link to comment
https://forums.phpfreaks.com/topic/108269-countdown-timer/#findComment-555040
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.