Calendar
There are many JavaScript-written calendars on the web that read local time and may not be accurate. So want to find a PHP written, can read the server time calendar, but has not been able to find the appropriate, so I try to write a.
Code
<?php $mnow = (isset ($HTTP _get_vars[' month ']) && intval ($HTTP _get_vars[' month ']) >0 && intval ($ http_get_vars[' month '] <13)? intval ($HTTP _get_vars[' month ']):d ate ("M"); $ynow = (Isset ($HTTP _get_vars[' year ') && intval ($HTTP _get_vars[' year ") >1969 && intval ($HTTP _get_vars[' year ') <2038)? Intval ($HTTP _get_vars[' year ']:d ate ("Y"); $mtime =mktime (0,0,0, $mnow, date ("D"), $ynow); $f =date ("W", Mktime (0,0,0, $mnow, 1, $ynow )) -1;echo "<table id=\" calendar\ "border=\" 0\ "cellpadding=\" 2\ "cellspacing=\" 1\ ">"; echo "<TR><TD" Colspan=\ "4\" align=\ "Center\" class=\ "calendartitle\" ><a href=\ "?". ($mnow!=date ("M")? Month= ". Intval ($mnow)." & ""). " Year= ". (Intval ($ynow) ==1970? " 1970 ": Intval ($ynow)-1)." "><</a>". $ynow. " <a href=\ "?". ($mnow!=date ("M")? Month= ". Intval ($mnow)." & ""). " Year= ". (Intval ($ynow) ==2037? " 2037 ": Intval ($ynow) +1)." \ ">></a></td><td colspan=\" 3\ "align=\" Center\ "class=\" calendartitle\ "><a href=\ "Month=". (Intval ($mnow) ==1? " ": Intval ($mnow)-1). ($ynow!=date ("Y")? " &year= ". Intval ($ynow):" "." \ ><</a>. Date ("M", $mtime). " <a href=\ "? month=". (Intval ($mnow) ==12? " 1 ": Intval ($mnow) +1). ($ynow!=date ("Y")? " &year= ". Intval ($ynow):" "." \ >></a></td></tr> echo "<tr><td class=\" Calendartop\ ">s</td><td Class=\ "Calendartop\" >m</td><td class=\ "calendartop\" >t</td><td class=\ "Calendartop\" >W</TD><TD class=\ "calendartop\" >t</td><td class=\ "Calendartop\" >F</td><td Class=\ "Calendartop\" >S</td></tr> for ($i =0; $i <date ("T", $mtime) + $f +1; $i + +) {if ($i%7==0) echo " <tr> echo "<td". (($i-$f ==intval (date ("D")) && $mnow ==date ("M") && $ynow ==date ("Y"))? "Id=\" calendartoday\ "" "" "). (($i%7==0 | | $i%7==6) "class=\" calendarw\ "" "" ")." > "; if ($i > $f) echo $i-$f; echo" </td> "; if ($i%7==6) echo" </tr> ";} if ($i%7<6 && $i%7>0) echo "<td colspan=\" ". (7-$i%7). " \ ></td></tr> if ($i%7==6) echo "<td></td></tr>", echo "</table>";? >