Welcome to Techno Smarter QA, Question, Answer forum. Ask questions, receive answers, or help someone. Join Now
+3 votes
How can the timer be coded to reset automatically after 30 seconds and repeat the countdown?
in PHP by (210 points) 2 5 11
You can use meta referesh . The meta referesh will refresh the page after 30 seconds and the countdown timer will be start automatically .

1 Answer

+1 vote

I commented and suggested using a meta refresh to reset countdown timer automatically. When countdown timer time ended then meta refresh reshes the whole page and countdown timer starts from the 30 seconds. This process will continue again and again and never stop. It's a method to reset countdown clock timer using Meta refresh and also you can set any value using PHP programming. 

<!DOCTYPE html>



<title> Refresh countdown timer automatically</title>







function countDown(secs,elem) {

var element = document.getElementById(elem);

element.innerHTML = "Timer: "+secs+" seconds";

if(secs < 1) {


element.innerHTML += '<meta http-equiv="refresh" content="0; url= ">';



var timer = setTimeout('countDown('+secs+',"'+elem+'")',1000);



<div id="status"style="font-size:30px;"></div>

<script> countDown(<?php echo $phpvar; ?>,"status");</script>



by (9.1k points) 11 25 63