I'm trying to make this calendar for my web-page ( http://andrewtarium.openzero.com ), but I cannot get this script to work
for($i = 0; $i < 6; $i++)
{
echo "<tr> \n <td align=\"center\"> \n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
echo "<tr> \n <td width=\"6\"><img src=\"images/calend.gif\"></td>";
for($x = 0; $x < 8; $x++)
{
if($print == 0)
{
if($first == $x)
{
$print == 1;
}
else
{
echo "<td width=\"18\" class=\"daten\"> </td>";
}
}
if($print == 1)
{
echo "<td width=\"18\" ";
if ($dayon == $today)
{
echo "class=\"datet\"> </td>";
}
else
{
echo "class=\"date\"> </td>";
}
$dayon++;
}
}
echo "<td width=\"6\"><img src=\"images/calend1.gif\"></td> \n </tr> \n </table> \n </td> \n </tr>";
}
Yes, I did declaire the variables. It seems that print never gets changed. Print finds out whether the first day (sun, mon) has arrived so I can start to fill in the rest of the month. $i controls the week and $x controls the day (sun, mon...). $first is the numerical day (0 = sun...). Evidently, this line "if($first == $x)" is always false. I cannot figure out why.
Aqua-Soft Forums