Refresh content with <select> tag

Hi everybody, I have a problem, sure you can help me again with php.
Ok, Im creating a management system for a calendar I created on flash. it is just a form to insert events into a mySQL database. I know how to do it, so it isnt any problem. The thing is… I have two select tags, one to select montho and other to select day, but if you select for example February the select ‘day’ menu must contain only 28 or 29 numbers, although if you select december i must contain 31 days. I need to know how to pass the month variable to the day select tag in order to load the correct number of days for each month. Thank you a lot!