萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> php編寫的鬧鐘程序

php編寫的鬧鐘程序

<?php

//鬧鐘程序

error_reporting(7
);

ob_start
();

if (!isset($i
)) {

    $msg= '現在時間是: '. date('h:i:s') ."<BR>趕快睡覺吧"
;

    $t=time
();

    refresh($msg,"funny.php?i=1&t1=$t",5
);

}elseif ($i==1
){

    $msg= '現在時間是: '. date('h:i:s'
);

    $t2=time
();

    $t3=$t2-$t1
;

    $msg.="<BR>你睡了 $t3 秒, 該起床啦"
;

    refresh($msg,'funny.php?i=2'
);

}elseif ($i==2
) {

    

//  

    
print <<<EOT2

<object id="MediaPlayer1" width="350" height="68" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 

codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" 

align="baseline" border="0" standby="Loading Microsoft Windows Media Player components..." 

type="application/x-oleobject">

     <param name="invokeURLs" value="0">

     <param name="FileName" value="http://218.30.20.121:5699/huyanbin/MuSiC/HuAnson08.Wma">

     <param name="ShowControls" value="1">

     <param name="ShowPositionControls" value="0">

     <param name="ShowAudioControls" value="1">

     <param name="ShowTracker" value="1">

     <param name="ShowDisplay" value="0">

     <param name="ShowStatusBar" value="1">

     <param name="AutoSize" value="0">

     <param name="ShowGotoBar" value="0">

     <param name="ShowCaptioning" value="0">

     <param name="AutoStart" value="1">

     <param name="PlayCount" value="0">

     <param name="AnimationAtStart" value="0">

     <param name="TransparentAtStart" value="0">

     <param name="AllowScan" value="0">

     <param name="EnableContextMenu" value="1">

     <param name="ClickToPlay" value="0">

     <param name="DefaultFrame" value="datawindow">


     <embed src="http://218.30.20.121:5699/huyanbin/MuSiC/HuAnson08.Wma" align="baseline" border="0" width="350" height="68"

             type="application/x-mplayer2"

             pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;"

             name="MediaPlayer" showcontrols="1" showpositioncontrols="0"

             showaudiocontrols="1" showtracker="1" showdisplay="0"

             showstatusbar="1"

             autosize="0"

             showgotobar="0" showcaptioning="0" autostart="1" autorewind="0"

             animationatstart="0" transparentatstart="0" allowscan="1"

             enablecontextmenu="1" clicktoplay="0" 

             defaultframe="datawindow" invokeurls="0">

     </embed>

</object>

EOT2;

}


function     refresh($msg='',$url,$time='3'
){

    echo $msg."<BR>"
;

    echo "<meta http-equiv=refresh content="$time;url=$url">"
;

    

}

?>

copyright © 萬盛學電腦網 all rights reserved