Jump to content

Need help with Countdown timer

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Myvision

Myvision

    Newbie

  • Members
  • Pip
  • 6 posts
Hey

I need a countdown timer, I am trying to assign a PHP Variable for the value so it starts counting down from there.

For ex;
$seconds = 20; // PHP Variable assigned 20


The countdown timer will start counting down from 20 till it reaches 0.

Help would be really appreciated :)

if this can be possible in JavaScript please help me with that.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
A count down timer in PHP alone will require output buffering, which will rely on extremely specific browser behaviours. This can be done in AJAX which is Javascript, or in Javascript alone, so I will move this to the appropriate forum.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
Myvision

Myvision

    Newbie

  • Members
  • Pip
  • 6 posts

Alexander said:

A count down timer in PHP alone will require output buffering, which will rely on extremely specific browser behaviours. This can be done in AJAX which is Javascript, or in Javascript alone, so I will move this to the appropriate forum.

Thank You.

#4
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
The setTimeout() function in JavaScript might help.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users