-1
計時器java腳本在本地服務器上正常工作。但是當我在託管服務器上運行它時,它不會啓動計時器。計時器腳本不能在託管服務器上工作
<script type="text/javascript" >
<?php
$elapsed=time()-strtotime($_SESSION['starttime']);
if(((int)$elapsed/60)<(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;";
}
?>
</script>
什麼不行?你有其他/錯誤的輸出?如果是這種情況,請確保服務器上的時間設置正確。 – Devator 2012-04-27 10:17:06
實際上定時器不啓動時運行託管服務器....? – baljeet 2012-04-27 11:25:42