胡乱弄的一个,把这段代码COPY到网页上试试<?
$timenow=time();
$yearnow=date("Y",$timenow);
$monthnow=date("m",$timenow);
$daynow=date("d",$timenow);
if ($day=="")
$day=$daynow;
if ($year!="")
{
$checkyear=$year;
}
else
{
$checkyear=$yearnow;$year=$yearnow;
}
if ($month!="")
{
$checkmonth=$month;
}
else
{
$checkmonth=$monthnow;$month=$monthnow;
}?>
                              <?php 
echo "<font color=ff0000 size=22>$day</font>";
?>
                              <br>
                              <br>
                              星期<?php 
$select_day=gmmktime(00,00,00,$month,$day,$year);
$x=date('w',$select_day);
if ($x==1)
echo "一";
if ($x==2)
echo "二";
if ($x==3)
echo "三";
if ($x==4)
echo "四";
if ($x==5)
echo "五";
if ($x==6)
echo "六";
if ($x==0)
echo "日";
  ?><br>
                              <table align="center" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" style="border-collapse: collapse">
                                <tr> 
                                  <td>
                                    <div align="center"> 
                                      <select name="year" onChange="MM_jumpMenu('self',this,0)" class=send>
                                        <?php 
       $j=2050;
for ($i=2002;$i<=$j;$i++)
{
if ($checkyear==$i)
echo "<option value='schedule.php?year=$i&month=$checkmonth' selected>$i</option>";
else
echo "<option value='schedule.php?year=$i&month=$checkmonth'>$i</option>";
}
?>
                                      </select>
                                      年 
                                      <select name="menu2" onChange="MM_jumpMenu('self',this,0)" class=send>
                                        <?php 
for ($i=1;$i<=12;$i++)
{
if ($i<10)
$j="0".$i;
else
$j=$i;
if ($month==$j)
echo "<option value='schedule.php?year=$checkyear&month=$j' selected>$j</option>";
else
echo "<option value='schedule.php?year=$checkyear&month=$j'>$j</option>";
}
?>
                                      </select>
                                      月 
                                      <?php 
$a=$year%4;
if ($month==1)
$dayall=31;
if (($a==0) and ($month==2))
$dayall=29;
if (($a!=0) and ($month==2))
$dayall=28;
if ($month==3)
$dayall=31;
if ($month==4)
$dayall=30;
if ($month==5)
$dayall=31;
if ($month==6)
$dayall=30;
if ($month==7)
$dayall=31;
if ($month==8)
$dayall=31;
if ($month==9)
$dayall=30;
if ($month==10)
$dayall=31;
if ($month==11)
$dayall=30;
if ($month==12)
$dayall=31;
$starttime=gmmktime(00,00,00,$month,01,$year);
$weekstart=date('w',$starttime);
  ?>
                                    </div></td>
        </tr>
        <tr> 
          <td > <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
                                      <tr BGCOLOR='#ebebeb'onMouseOver="this.style.backgroundColor='#8A8A8A';" onMouseOut=this.style.backgroundColor='#ebebeb'> 
                                        <td width="25"  > 
                                          <div align="center">日</div></td>
                                        <td width="25"  > 
                                          <div align="center">一</div></td>
                                        <td width="25" > 
                                          <div align="center">二</div></td>
                                        <td width="25" > 
                                          <div align="center">三</div></td>
                                        <td width="25" > 
                                          <div align="center">四</div></td>
                                        <td width="25" > 
                                          <div align="center">五</div></td>
                                        <td width="25"  > 
                                          <div align="center">六</div></td>
              </tr>
              <?php 
$x=0;
echo "<tr >";
for ($i=0;$i<$weekstart;$i++)
echo "<td align=center'></td>";
for ($i=1;$i<=$dayall;$i++)
{
if ((($i+$weekstart)%7==0) and ($i==$dayall))
{
echo "<td align=center><font color=#CC0066><a href=schedule.php?year=$year&month=$month&day=$i>$i</a></font></td></tr>";
$finish="Y";
}
if ((($i+$weekstart)%7==0) and ($i!=$dayall))
{
echo "<td align=center><font color=#CC0066><a href=schedule.php?year=$year&month=$month&day=$i>$i</a></td><tr>";
$x=0;
}
if (($i+$weekstart)%7!=0)
{
echo "<td align=center><font color=#CC0066><a href=schedule.php?year=$year&month=$month&day=$i>$i</a></td>";
$x++;
}
}
if ($finish!="Y")
{
$y=7-$x;
for ($i=0;$i<$y;$i++)
echo "<td align=center></td>";
echo "</tr>";
}
?>
            </table></td>
        </tr>
      </table>

解决方案 »

  1.   

    我有万年历(包括200年农历)的代码,要吗?
    给我你email,给你发过去
      

  2.   

    [email protected]
    给我一份吧!
      

  3.   

    麻烦也给我一份
    [email protected]
      

  4.   

    give me a copy, [email protected]
      

  5.   


         麻烦抄送一份给我
         [email protected]    
      

  6.   

    万年历阿,不错阿新新也要嘛[email protected]谢谢哥哥
      

  7.   

    我也要丫...麻烦发给我一个....谢谢了[email protected]
      

  8.   

    我也要看看~~
    [email protected]
      

  9.   

    我也要一个万年历,谢谢了![email protected]
      

  10.   

    麻烦你了,请也传一封给我吧!谢谢![email protected]
      

  11.   

    给我也看看吧!谢谢!    [email protected]