Domanda

I want to test before registration email and password, the goal is to refuse the password if it contains any portion of the username or email.

And secondly, it cannot include common dictionary words.

Any idea or link to help me ?

È stato utile?

Soluzione

Please give this code a try. I believe this will help

<?php
$username = "Zameer";
$email = "zameer.khan@email.com";
$password = "thisiszameer";

if (stripos($password, $username) !== false) {
    echo "Password contains username";
}
else if (stripos($password, $email) !== false) {
    echo "Password contains email";
}
else {
    echo "Does not contain username or email";
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top