Timer script not working on hosting server
<p>A timer java script is working fine on local server. But when i run it on hosting server it does not intiate the timer.</p>

<pre><code>&lt;script type="text/javascript" &gt;
&lt;?php
    $elapsed=time()-strtotime($_SESSION['starttime']);
    if(((int)$elapsed/60)&lt;(int)$_SESSION['duration'])
    {
        $result=executeQuery("SELECT " .
        " TIME_FORMAT(TIMEDIFF(endtime,CURRENT_TIMESTAMP),'%H') as hour, ".
        " TIME_FORMAT(TIMEDIFF(endtime,CURRENT_TIMESTAMP),'%i') as  min, ".
        " TIME_FORMAT(TIMEDIFF(endtime,CURRENT_TIMESTAMP),'%s') as sec ".
        " FROM studenttest ".
        " WHERE stdid=".$_SESSION['stdid'].
        " AND testid=".$_SESSION['testid'].";");
        if($rslt=mysql_fetch_array($result))
        {
            echo "var hour=".$rslt['hour'].";";
            echo "var min=".$rslt['min'].";";
            echo "var sec=".$rslt['sec'].";";
        } else {
            $_GLOBALS['message']="Try Again";
        }
        closedb();
    } else {
        echo "var sec=01;var min=00;var hour=00;";
    }
?&gt;
&lt;/script&gt;
</code></pre>
