-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcounter.php
More file actions
41 lines (33 loc) · 952 Bytes
/
counter.php
File metadata and controls
41 lines (33 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// echo '<script type="text/javascript"> // JS code ... </script>';
?>
<!-- HTML code -->
<script type="text/javascript">
var myVar = setInterval("ceas()",1000);
</script>
<div id="tag_ora"></div>
<script type="text/javascript"><!--
function endClock($bcode) {
clearInterval(myVar);
alert("Congrats! You've Completed the Challenge!");
}
// use php to get the server time
var serverdate = new Date(<?php echo date('y,n,j,G,i,s'); ?>);
var minute = 0 // minutes
var second = 0 // seconds
// function that process and display data
function ceas() {
//dClock('test');
second++;
if (second>59) {
second = 0;
minute++;
}
var output = "<div align='center' style='font-size:300%'><b>"+minute+":"+second+"</b></div>"
document.getElementById("tag_ora").innerHTML = output;
}
// call the function when page is loaded and then at every second
//window.onload = function(){
// setInterval("ceas()", 1000);
//}
--></script>