I am using the following jQuery script that countdowns the time until the $end and when this happen it displays completed.
However when you change the time on your computer, the countdown is changed. What I had in mind is like those countdowns that Groupon has.
My question is how to change the time source in something that can not be changed, maybe the server's time? And when the timer reaches 0, how can I run a SQL query using PHP?
Am I totally in the wrong way?
Thank you.
<?php $end = 'september 1, 2011 19:24'; ?>
<script type="text/javascript">
$(document).ready(function() {
$("#time").countdown({
date: "<?=$end?>",
onComplete: function( event ){
$(this).html("<i>Completed</i>");
},
leadingZero: true
});
});
</script>
<p id="time" class="time"></p>