I am having a problem with my code that decides which cell to echo in a table, the array is a list of days of that month ie, 6, 10, 11, 24, 31. I want the calendar to post a cell with a certain back ground if it is the same day as one of the dates in the array and a different one if it is not. here is what I have:
for ($n=1; $n<=$fdmv; $n++)
{
$rcv++;
echo "<td><font face=Arial size=-2></font></td>\n";
}
while ($dcv <= $mda[$cmv])
{
if ($rcv % 7 == 0)
{
echo "</tr>\n<tr>\n";
}
for ($y=0; $y<sizeof($dateList); $y++)
{
if ($dcv == $dateList[$y])
{
echo "<td align=center bgcolor=silver><font face=Arial size=-1>".$dcv."</font>";
}
else
{
echo "<td align=center bgcolor=red><font face=Arial size=-1>".$dcv."</font>";
}
echo "</td>\n";
$dcv++;
$rcv++;
}
$dcv is the day of the month. this will posts like 10 cells for each date, but the first time it posts the cell it does do it with the correct color, any ideas? I see why it doesnt work is because of the else, but if I dont put the else, how do i get the 2nd echo??