Good morning,
Through a registration form, I receive mail among other things. To check that it is an email I do a series of simple checks, however when trying to find the position of certain characters like @
it does not return anything to me.
$mail = trim($_POST['mail']);
$pos = strpos($mail, "@");
$pos2 = strpos($mail, ".com");
$pos3 = strpos($mail, ".es");
if ($pos == "false" OR $pos2 == "false" OR $pos3 == "false") {
$errores .= "Correo electrónico no válido </ br>";
} else {
if ($mail != $remail) {
$errores .= "Las contraseñas no coinciden </ br>";
}
}
The mail receives it well but in the variables of $pos
I do not receive anything, neither a number nor false. I know that I can put in the type of input email, so that it checks if it is an email, but I prefer to do it manually.
I would appreciate any help.