Can somebody please tell me why my problem is occurring. I have worked trying different things all morning and cannot figure it out. The problem is that I need to go from month to month. It works good til the end of the month and now in January it is skipping over the month of February. A sample can be seen at
http://www.oksafety.org/calendar2.php
<?php
if (!isset($_GET['cal'])) {
$iCalTracker = 0;
} else {
$iCalTracker = $_GET['cal'];
}
$iLastMonth = $iCalTracker - 1;
$inextMonth = $iCalTracker + 1;
$curMonth = strftime ("%d/%m/%Y", strtotime($iCalTracker . " month"));
echo $curMonth . " curr month<BR>";
------Results-- 31/01/2006 curr month
$exploded_date = explode('/', $curMonth);
$curViewMonth = date("F", mktime(0, 0, 0, $exploded_date[1], $exploded_date[0], $exploded_date[2]));
echo $curViewMonth;
if ($iCalTracker > 0 && empty($_GET['view'])) {
$lastViewMonth = date("F", mktime(0, 0, 0, $exploded_date[1]-1, $exploded_date[0], $exploded_date[2]));
echo "<a href='calendar.php?cal=" . $iLastMonth . "'><< " . $lastViewMonth . "</a>";
}
-------This is where it jumps over February and go straight to March
if(empty($_GET['view'])) {
$nextViewMonth = date("F", mktime(0, 0, 0, $exploded_date[1]+1, $exploded_date[0], $exploded_date[2]));
echo "<a href='calendar.php?cal=" . $inextMonth . "'>" . $nextViewMonth . " >></a>";
}
?>
Thanks In Advance
mike