欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php编写的闹钟程序

程序员文章站 2022-05-25 10:43:29
...
php

//闹钟程序

error_reporting(7
);

ob_start
();

if (!isset(
$i
)) {

$msg= '现在时间是: '. date('h:i:s') ."
赶快睡觉吧"
;

$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.="
你睡了 $t3 秒, 该起床啦"
;

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

}elseif (
$i==2
) {



//

print

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">









































type="application/x-mplayer2"

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

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">





EOT2;

}


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

echo
$msg."
"
;

echo
""
;



}

?>