This is the code I'm working with.
My only problem is when I try and increment the month, the date defaults to January 2000, any ideas?
if($submit) {
// Subtract one from the month for previous, add one for next
if ($submit == "Prev") {
$month_now--;
} else {
$month_now++; }
$date = getdate(mktime(0,0,0,$month_now,1,$year_now));
} else {
$date = getdate();
}
$month_num = $date["mon"];
$month_name = $date["month"];
$year = $date["year"];
$date_today = getdate(mktime(0,0,0,$month_num,1,$year));
$first_week_day = $date_today["wday"];
$cont = true;
$today = 27;
while (($today <= 32) && ($cont)) {
$date_today = getdate(mktime(0,0,0,$month_num,$today,$year));
if ($date_today["mon"] != $month_num) {
$lastday = $today - 1;
$cont = false;
}
$today++;
}
echo $month_num;
echo $month_name;
echo $year;