-- test.php --
<?php
$x_time = date("Y-m-d H:i:s"); // 서버시간을 x_time변수에 넣음.
if($x_time == "2006-03-27 18:29:22") { // x_time이 특정시간이 되면 처리되어야 할 부분
// 특정시간이 되면 처리해야될 부분.
} else {
echo $x_time; // 아니면 현재시간 출력
}
?>
-- test.html --
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<META http-equiv=Content-Type content="text/html; charset=ks_c_5601-1987">
<SCRIPT language=JavaScript src="test.files/jslb_ajax.js" charset=utf-8></SCRIPT>
<SCRIPT language=JavaScript>
function junTime() {
req = createHttpRequest()
req.onreadystatechange = function() {
if( req.readyState == 4 ) {
Clock.innerHTML = req.responseText;
}
}
req.open("GET","./test.php");
req.send("");
window.setTimeout("junTime();", 1000);
}
window.onload = junTime;
</SCRIPT>
</HEAD>
<BODY>
<DIV id="Clock" name="Clock" style="FONT-SIZE: 9px; Z-INDEX: 1; LEFT: 7px; WIDTH: 150px; COLOR: black; FONT-FAMILY: tahoma; POSITION: absolute; TOP: 5px; HEIGHT: 20px"></DIV>
</BODY>
</HTML>