Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/pages/timer.php
<?php
################################################################################
##              -= This is a template for dynamic php file =-                  #
################################################################################

    // Initialize the session.
    session_start();
    
    require_once("../inc/classes/session.class.php");	
    require_once("../inc/checkPagePermissions.php");
	require_once("../inc/functions.inc.php");
	
    $page_array = explode('/', $_SERVER['SCRIPT_NAME']);
    $page = $page_array[count($page_array) - 1]; 
    if(!page_access_allowed("dynamic_pages.php", $page)) redirect_to("../system/access_denied.php");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Site :: Home</title>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <SCRIPT language="JavaScript">
    <!-- //Timer in JavaScript
    var timerform
    speed=1000
    function dotimer()
    {
    today=new Date()
    slutsec=today.getSeconds()
    slutmin=today.getMinutes()
    sluttim=today.getHours()
    sluta=(slutsec) + 60 * (slutmin) + 3600 * (sluttim)
    diff=sluta - starta
    tim=Math.floor(diff / 3600)
    min=Math.floor((diff / 3600 - tim) * 60)
    sek=Math.round((((diff / 3600 - tim) * 60) - min) * 60)
    document.timerform.timer.value=tim + ':'
    if(min<10)document.timerform.timer.value+='0'
    document.timerform.timer.value+=min + ':'
    if(sek<10)document.timerform.timer.value+='0'
    document.timerform.timer.value+=sek
    window.setTimeout("dotimer()",speed)
    }
    function Timer()
    {
    today=new Date()
    startsek=today.getSeconds()
    startmin=today.getMinutes()
    starttim=today.getHours()
    starta=(startsek) + 60 * (startmin) + 3600 * (starttim)
    document.write('<form name=timerform><input readonly name=timer size=7')
    document.write('></form>')
    dotimer()
    }
    // end-->
    </SCRIPT>
</head>

<body>
    <?php
  
        echo "This is PHP Dynamic Page: timer.php <br/>";
        echo "This page was created on: Sep 04, 2009 02:44 PM <br/>";
    ?>

<br />
<table width=420>
<tr>
<td align=center>
TIMER:
<SCRIPT language="JavaScript">
 Timer() 
</SCRIPT>
</td>
</tr>
</table>

</body>
</html>
Return current item: Basic Announce