Using PHP and jQuery, I was able to make this countdown timer. I've searched various books and obviously on Google, but couldn't find this type of approach as used by me here. I sincerely feel there is something wrong with it. Can anyone tell me if this is the right approach?
<!DOCTYPE html>
<html>
<head><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
<script>
$(document).ready(function(){
$("#recdisp").load("countdown.php");
});
setInterval( function(){ $("#recdisp").load("countdown.php")}, 1000 );
</script>
<div id="recdisp"></div>
</html>
recdisp.php
<?php
date_default_timezone_set("Asia/KolKata");
$time=1434402728+3600000*24*10000;//some time in future.
echo "<div class=\"d\">";
echo (date("d",$time-time())-1);
echo "</div>";
echo "<div class=\"l\">";
echo " Days ";
echo "</div>";
echo "<div class=\"d\">";
echo (date("h",$time-time()));
echo "</div>";
echo "<div class=\"l\">";
echo " Hours ";
echo "</div>";echo "<div class=\"d\">";
echo (date("i",$time-time()));
echo "</div>";
echo "<div class=\"l\">";
echo " Minutes ";
echo "</div>";
echo "<div class=\"d\">";
echo (date("s",$time-time()));
echo "</div>";
echo "<div class=\"l\" >";
echo " Seconds ";
echo "</div>";
?>