Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- function getTime(){
- setTimeout("getTime()", 1000);
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- document.getElementById("c").innerHTML=xmlhttp.responseText;
- }
- xmlhttp.open("GET", "time.php",true);
- xmlhttp.send();
- document.getElementById('d').innerHTML=Date();
- }
- getTime();
- </script>
- </head>
- <body>
- <p>PHP says <span id="c"> </span></p>
- <p>JavaScript says the time is <span id="d"></span><p>
- </body>
- </html>
- <?php
- echo "The date and time is " . date("d/mY h:i:sa") . ".";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement