Well...
1) The first time your page is displayed, the form has not yet been submitted, so there is not "startmonth" element in the $HTTP_POST_VARS array. The warning is accurate.
2) You can not specify a PHP script as a javascript event handler (onChange). Javascript is client side (runs in the web browser AFTER a page is downloaded) whereas PHP is server side (runs before a page is sent to the browser, and then only the results of the PHP is sent!)
You have three options for what you are trying to accomplish:
1) Use javascript to populate the second combo box based on the value of the first combo box (using the onChange event).
2) Use javascript to execute the form.submit() function in the onChange event of the first combo box to call your script again so you can re-output the form with the second combo box populated accordingly.
3) Just download one of the free javascript date pickers located all over the internet that will populate a form field with a valid date picked from a real pretty calendar pop-up.
-- Rich