我正在进行日期验证,但它一直给我一条错误消息
注意:未定义变量:第 15 行 C:\xampp\htdocs\signup.php 中的部分
if (empty($_POST['birthday']))
// the user's date of birth cannot be a null string
$errors[] = "You must supply a date of birth.";
else if (!strpos("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", $_POST['birthday'], $parts))
// Check the format
$errors[] = "The date of birth is not a valid date in the " .
"format DD/MM/YYYY";
elseif (!checkdate($parts[2],$parts[1],$parts[3]))
$errors[] = "The date of birth is invalid. " .
"Please check that the month is between 1 and 12, " .
"and the day is valid for that month.";
elseif (intval($parts[3]) < 1890)
// Make sure that the user has a reasonable birth year
$errors[] = "You must be alive to use this service.";