This is just a simple calendar program - the code below works great once I select a month and year on my form and submit it - but upon opening the page it default to January of 1969. The only thing I know for sure is the $month variable initially doesn't hold the month number but rather the month name (ie. July not 6) - where as once I use the form to select the $month now holds the Month number not the Month name.
Anyone have an idea what I done wrong here?
Thanks,
if((!isset($_POST["month"])) || (!isset($_POST["year"]))) {
$nowArray = getdate();
$month = $nowArray["month"];
$year = $nowArray["year"];
} else {
$month = $_POST["month"];
$year = $_POST["year"];
}
$start = mktime (12, 0, 0, $month, 1, $year);
$firstDayArray = getdate($start);