Hi Guys, I would like to highlight the current day on this php script, can you help me figure out a simple way to do this?
<?php
$monthNames = Array("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");
if (!isset($_GET["m"])) $_GET["m"] = date("n");
if (!isset($_GET["y"])) $_GET["y"] = date("Y");
$currentMonth = $_GET["m"];
$currentYear = $_GET["y"];
$p_year = $currentYear;
$n_year = $currentYear;
$p_month = $currentMonth-1;
$n_month = $currentMonth+1;
if ($p_month == 0 ) {
$p_month = 12;
$p_year = $currentYear - 1;
}
if ($n_month == 13 ) {
$n_month = 1;
$n_year = $currentYear + 1;
}
$days=array('1'=>"S",'2'=>"M",'3'=>"T",'4'=>"W",'5'=>"T",'6'=>"F",'7'=>"S");
?>
<table width="100%">
<tr align="center">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?m=". $p_month . "&y=" . $p_year; ?>" style="color:#FFFFFF">Prev</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?m=". $n_month . "&y=" . $n_year; ?>" style="color:#FFFFFF"> Next</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr align="center">
<td colspan="7"><B><?php echo $monthNames[$currentMonth-1].' '.$currentYear; ?></B></td>
</tr>
<tr >
<?php for($i=1;$i<=7;$i++){ ?>
<td align="center"><B><?php echo $days[$i]; ?></B></td>
<?php } ?>
</tr>
<?php
$timestamp = mktime(0,0,0,$currentMonth,1,$currentYear);
$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