Hello,
this is my first post in this new forum. I really hope that someone can help me, as I am really getting headaches from sleepless nights trying to solve this problem.
I need to say in advance that I am a total newbie with scripting in php.
I have found this php calendar script but i would like it to have today's date of a different color.
Any help/suggestion would be gratefully appreciated.
calendar.php
<html>
<body>
<?php
$month_Names = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
$Current_Month = $_REQUEST["month"];
$Current_Year = $_REQUEST["year"];
$prev_year = $Current_Year;
$next_year = $Current_Year;
$prev_month = $Current_Month-1;
$next_month = $Current_Month+1;
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $Current_Year - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $Current_Year + 1;
}
?>
<table width="200">
<tr align="center">
<td style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td align="left"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#808080"> << </a></td>
<td align="center" style="color:#000000"><strong><?php echo $month_Names[$Current_Month-1].' '.$Current_Year; ?></strong></td>
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>" style="color:#808080"> >> </a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" clspan="7">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="center" style="color:#FF0000"><strong>S</strong></td>
<td align="center" style="color:#000000"><strong>M</strong></td>
<td align="center" style="color:#000000"><strong>T</strong></td>
<td align="center" style="color:#000000"><strong>W</strong></td>
<td align="center" style="color:#000000"><strong>T</strong></td>
<td align="center" style="color:#000000"><strong>F</strong></td>
<td align="center" style="color:#FF0000"><strong>S</strong></td>
</tr>
<?php
$timestamp = mktime(0,0,0,$Current_Month,1,$Current_Year);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++) {
if(($i % 7) == 0 ) echo "<tr>";
if($i < $startday) echo "<td></td>";
else echo "<td align='center' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>";
if(($i % 7) == 6 ) echo "</tr>";
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
How do I change the color of today's date ?
Regards,