我记得以前注册过一个域名:rbyoung.com,并且域名和空间激活之后写过一个首页。先上图:
再上代码:
<?php
header("Content-type:text/html;charset=utf-8");
date_default_timezone_set("Asia/Shanghai");
$t = getdate();
$h = $t['hours'];
if ($h>=3 && $h<6) {
$str = "凌晨了,睡不着么?";
} elseif ($h>=6 && $h<8 ) {
$str = "早上好!一日之计在于晨,要坚持哦! ^_^";
} else if ($h>=8 && $h<11) {
$str = "上午好,努力工作哦! ^_^";
} else if ($h>=11 && $h<13) {
$str = "中午了,该休息了吧.";
} else if ($h>=13 && $h<17) {
$str = "下午了,今天工作还好么? (⊙o⊙)?";
} else if ($h>=17 && $h<19) {
$str = "傍晚了,出去散步么?";
} elseif ($h>=19 && $h<23) {
$str = "晚上了,今天有什么收获呢, :-D";
} elseif ($h>=23 || $h<3 ) {
$str = "夜深了,早点睡吧, =_= ";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::test::</title>
<style type="text/css">
.hh {
font-size:12px;
color:#0066FF;
font-family:Arial;
margin:0px;
padding:0px;
display:block;
padding-bottom:5px;
}
.sp1 {
font-size:12px;
font-family:Verdana;
color:#000;
display:block;
padding-bottom:5px;
}
.dv {
width:300px;
height:100px;
background-color:#eee;
padding-top:20px;
padding-left:30px;
float:right;
}
.dv2 {
width:200px;
height:20px;
line-height:20px;
font-size:12px;
font-family:arial;
padding-left:5px;
background-color:#ccc;
float:left;
}
#main {
width:535px;
height:100px;
padding-top:40px;
margin-left:auto;
margin-right:auto;
}
}
</style>
</head>
<body>
<div id="main">
<div class="dv2"><?php echo $str ?></div>
<div class="dv">
<span class="hh">"寸之" 网站正在建设中...</span>
<span class="sp1">Hello,welcome to roberson's world.</span>
<span class="sp1">I'm roberson,daneil roberson young.</span>
<span class="sp1">I am a programmer.</span>
</div>
</div>
</body>
</html>