diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 1b0adea71dd..f3a364339b3 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -227,8 +227,8 @@ if (empty($reshook) && $action == 'add') {
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n";
}
- $birthday = dol_mktime(GETPOST('birthhour', 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int'));
- if (GETPOSTISSET('birthmonth') && empty($birthday)) {
+ $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
+ if (GETPOST("birthmonth") && empty($birthday)) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadDateFormat")."
\n";