i want to make some changes for my site,but i don't know how; and i will be glad if you could help me with that, if its possible to see really online the seconds counting until zero,not only the time has left and second, if i want that the countdown will start automatically to count again and start from the begining by a loop.
here is the code that I want to insert my changes
<?php
//You must call the function session_start() before
//you attempt to work with sessions in PHP!
session_start();
//Check to see if our countdown session
//variable has been initialized.
if(!isset($_SESSION['countdown'])){
//Set the countdown to 120 seconds.
$_SESSION['countdown'] = 120;
//Store the timestamp of when the countdown began.
$_SESSION['time_started'] = time();
}
//Get the current timestamp.
$now = time();
//Calculate how many seconds have passed since
//the countdown began.
$timeSince = $now - $_SESSION['time_started'];
//How many seconds are remaining?
$remainingSeconds = abs($_SESSION['countdown'] - $timeSince);
//Print out the countdown.
echo "There are $remainingSeconds seconds remaining.";
//Check if the countdown has finished.
if($remainingSeconds < 1){
//Finished! Do something.
}