In my system they have the possibility of registering their access data in lowercase or uppercase or varied and the records have no problem if not in the user and email verification filter.
Let's see how the problem occurs:
If we send an email to the following email addresses:
Email: -> [email protected] o usuario: -> Jose
Email: -> [email protected] o usuario: -> JoSe
Email: -> [email protected]
Email: ->[email protected] o usuario: -> JOSE
All the information will arrive at the same mail because for the mail servers that information remains the same regardless of the order of lowercase and uppercase.
Now in my system. If the user uses that same mechanism in my registration system, the system lets them register.
How did he pass a filter through PHP, that checks both data in lower case regardless of how the data is registered or how the user has sent it, the important thing is that both data is checked in lower case.
My current checks:
if($email == $emailDB){
echo "email utilizado";
}
if($username == $usernameDB) {
echo "usuario no disponemos";
}
If what you want is that both
emails
and bothusername
are compared both in lowercase, you could use the functionstrtolower()
that comes with php:In php there is the strtolower , which will allow you to convert your string to lowercase, which is what you are asking for: