I can't get my dates to land on the correct day, using the following code;
<thead><tr>
<th width=35>Mon</th>
<th width=35>Tue</th>
<th width=35>Wed</th>
<th width=35>Thu</th>
<th width=35>Fri</th>
<th width=35>Sat</th>
<th width=35>Sun</th>
</tr></thead>
<tbody><tr>
<?php
$columnCounter = 0;
for ($fillLeadingEmptyDays=0; $fillLeadingEmptyDays <= ($firstOfMonthDay - 1); $fillLeadingEmptyDays+=1) {
$columnCounter = $columnCounter + 1;
echo "<td height=22></td>";
}
for ($enterDays=1; $enterDays <= $daysInCurrentMonth; $enterDays+=1) {
$columnCounter = $columnCounter + 1;
echo "<td height=22";
if ($day == $enterDays) { echo " class = \"today\""; }
$dayLinkDestination = "default.php?day=".$enterDays."&month=".$month."&year=".$year."";
echo "><a href=\"".$dayLinkDestination."\">".$enterDays."</a></td>";
if ( $columnCounter == 7 ) {
echo "</tr><tr>";
$columnCounter = 0;
}
}
for ($fillEmptyDays=($columnCounter + 1); $fillEmptyDays <= 7; $fillEmptyDays+=1) {
if ($columnCounter ==0) {
break;
}
echo "<td height=22></td>";
}
?>
</tr></tbody>
</table>
With a call to;
<?php
$day = @$_GET["day"];
$month = @$_GET["month"];
$year = @$_GET["year"];
if ($month == ""){
$day = date('j');
$month = date('n');
$year = date('Y');
}
$firstOfMonthDateStamp = mktime(24, 60, 60, $month, 1, $year);
$daysInCurrentMonth = date("t", $firstOfMonthDateStamp);
$firstOfMonthDay = date("d", $firstOfMonthDateStamp);
$lastOfMonthDay = date("w", strtotime(date("n",$firstOfMonthDateStamp)."/".$daysInCurrentMonth."/".date("Y",$firstOfMonthDateStamp)));
$previousMonth = getdate(strtotime('-1 month', $firstOfMonthDateStamp));
$nextMonth = getdate(strtotime('+1 month', $firstOfMonthDateStamp));
?>
I wonder if anyone can point me in the right direction...
<thead><tr>
<th width=35>Mon</th>
<th width=35>Tue</th>
<th width=35>Wed</th>
<th width=35>Thu</th>
<th width=35>Fri</th>
<th width=35>Sat</th>
<th width=35>Sun</th>
</tr></thead>
<tbody><tr>
<?php
$columnCounter = 0;
for ($fillLeadingEmptyDays=0; $fillLeadingEmptyDays <= ($firstOfMonthDay - 1); $fillLeadingEmptyDays+=1) {
$columnCounter = $columnCounter + 1;
echo "<td height=22></td>";
}
for ($enterDays=1; $enterDays <= $daysInCurrentMonth; $enterDays+=1) {
$columnCounter = $columnCounter + 1;
echo "<td height=22";
if ($day == $enterDays) { echo " class = \"today\""; }
$dayLinkDestination = "default.php?day=".$enterDays."&month=".$month."&year=".$year."";
echo "><a href=\"".$dayLinkDestination."\">".$enterDays."</a></td>";
if ( $columnCounter == 7 ) {
echo "</tr><tr>";
$columnCounter = 0;
}
}
for ($fillEmptyDays=($columnCounter + 1); $fillEmptyDays <= 7; $fillEmptyDays+=1) {
if ($columnCounter ==0) {
break;
}
echo "<td height=22></td>";
}
?>
</tr></tbody>
</table>
With a call to;
<?php
$day = @$_GET["day"];
$month = @$_GET["month"];
$year = @$_GET["year"];
if ($month == ""){
$day = date('j');
$month = date('n');
$year = date('Y');
}
$firstOfMonthDateStamp = mktime(24, 60, 60, $month, 1, $year);
$daysInCurrentMonth = date("t", $firstOfMonthDateStamp);
$firstOfMonthDay = date("d", $firstOfMonthDateStamp);
$lastOfMonthDay = date("w", strtotime(date("n",$firstOfMonthDateStamp)."/".$daysInCurrentMonth."/".date("Y",$firstOfMonthDateStamp)));
$previousMonth = getdate(strtotime('-1 month', $firstOfMonthDateStamp));
$nextMonth = getdate(strtotime('+1 month', $firstOfMonthDateStamp));
?>
I wonder if anyone can point me in the right direction...