www.webdeveloper.com
Results 1 to 2 of 2

Thread: countdown timer

  1. #1
    Join Date
    Jun 2012
    Posts
    1

    countdown timer

    hai, I want to create a timer for online test page which gets the time duration for countdown from database and dosenot reset on page refresh.
    i have a timer which gets time from database but it resets on page refresh.
    i am using php mysql.
    i am a newbee so pls help me.
    thanks in advance.

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,270
    It easy to get a date with javascript from PHP like this

    Code:
    <?php
    	// Convert the timeLimit (coming from data base) to UTC 
    	$timeLimit=mktime(0,0,0,1,1,2013);
    ?>
    <script type="text/javascript">
    	// Define a javascript interger*1000 for seconds=>milliseconds 
    	var timeLimit=parseInt("<?php echo $timeLimit ?>");
    	var dateLimit=new Date(timeLimit*1000);
    	//... Display a countDown with this date 
    </script
    With the Bionoid countDown this can give something like this

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles