this isnt complicated but there is more to it then just copy/pasting a script into your files.
Basically what you can do is do a date comparison from a mysql table to match dates past your "cut off" date. You have to check your database for valid dates, you can either do this to generate your drop down so that only valid date's show, or let the user select which ever date they want and simply check if it's good after form submission.
either way, it's more involved then just a SQL problem, so links and code would help us out alot