At first glance :
Change your date expression format to
$year then $month then $day.
But, in doing this your date will be expressed in a two digits format, which will eventually lead to a true result if the user input something greter than 01 (like 99 ...). To address that, you shoud either write a simple test (like "if ($year>30) return false;" if you want to use your script till 2030) that could still lead to erroneous results, either use a four digits year format by using "$currentdate = (date("Ymd"));".
You will also have to make some data input format validation by checking if the input string is of the correct length and/or correct value. ie "if ($month>12) return false;"
And, of course, you shoud declare the global variables used in your function with something like "global $year, $month, $day;".