一个PHP日历程序_PHP教程

WBOY
Release: 2016-07-21 15:59:33
Original
764 people have browsed it

//
if($HTTP_GET_VARS[year]=="")
{
$HTTP_GET_VARS[year]=date("Y");
}
if($HTTP_GET_VARS[month]=="")
{
$HTTP_GET_VARS[month]=date("n");
}
$month=$HTTP_GET_VARS[month];
$year=$HTTP_GET_VARS[year];
//
if($year{
echo "出错!";
echo "
";
echo "Back";
exit();
}
?>







































";
}
else
{
$Font;
}
return $FontStyle;
}
for($i=0;$i{
for($i;$i {
echo "
\n";
}
if($i==$FirstDay)
{
echo "
\n";
if($FirstDay==6)//判断1号是否星期六
{
echo "













$d=date("d");$FirstDay=date("w",mktime(0,0,0,$month,1,$year));//取得任何一个月的一号是星期几,用于计算一号是由表格的第几格开始$bgtoday=date("d");function font_color($month,$today,$year)//用于计算星期天的字体颜色{$sunday=date("w",mktime(0,0,0,$month,$today,$year));if($sunday=="0"){$FontColor="red";}else{$FontColor="black";}return $FontColor;}function bgcolor($month,$bgtoday,$today_i,$year)//用于计算当日的背景颜色{$show_today=date("d",mktime(0,0,0,$month,$today_i,$year));$sys_today=date("d",mktime(0,0,0,$month,$bgtoday,$year));if($show_today==$sys_today){$bgcolor="bgcolor=#6699FF";}else{$bgcolor="";}return $bgcolor;}function font_style($month,$today,$year)//用于计算星期天的字体风格{$sunday=date("w",mktime(0,0,0,$month,$today,$year));if($sunday=="0"){$FontStyle=" ";}}}$countMonth=date("t",mktime(0,0,0,$month,1,$year));//某月的总天数for($i=2;$i{echo " \n";if(date("w",mktime(0,0,0,$month,$i,$year))==6)//判断该日是否星期六{echo "\n";}}?>

//
if($month{
$month=12;
$year-=1;
}
if($month>12)
{
$month=1;
$year+=1;
}
//
//***************************************
//
echo ">>";
?>


echo ">>";
//
?>
".font_style($month,1,$year)."1
".font_style($month,$i,$year)."$i


www.bkjia.com true http://www.bkjia.com/PHPjc/317347.html TechArticle ?php //-------处理通过GET方法提交的变量;开始-------- if($HTTP_GET_VARS[year]=="") { $HTTP_GET_VARS[year]=date("Y"); } if($HTTP_GET_VARS[month]=="") { $HTTP_GET_VARS[mon...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!