Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to display the server time with the use of ajax

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.59k
    Comment on it

    In this tutorial , you will learn that how to get the server time automatically with the use of jQuery-ajax code. We can make the simple input form in html for time.When the name is input by the user , the time input feild will automatically called from the server. You can use the below code fo getting the time automatically from server in input boxes

    <script src=""></script>
    //jquery and ajax function used to get the server time in the box
    url: "serverTime.php",
    success: function(result){
    //html for input box showing the server time
    <form name='myForm'>
    Name: <input type='text' name='name' id="name">
    Time: <input type='text' name='time' id="time"/>

    You can save this code in any of the named html file. after saving this code we can make other file to get the time of the server.You can save the file name serverTime.php as its already called above.

    Here is the code for the file.

    <?php echo date("H:i:s");?>


 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: