I already don't allow things like yahoo and AOL as well as a lot of offensive thinks as part of the email address (see below), but I need more. What I want is to stop users from creating member names that are the same as the unique part of their email addresses.
Like if the email is roger12345@yahoo.com I don't want to allow them to use roger12345 for a user name.
Here's what I have so far, in step_2.php:
// do not allow user name to contain common email address segments
if ( stristr($login, "yahoo") || stristr($login, "hotmail") || stristr($login, ".com") ||
stristr($login, "gmail") || stristr($login, "@") || stristr($login, "dotcom") ||
stristr($login, ".edu") || stristr($login, ".") || stristr($login, "aol") ||
stristr($login, "terracom") || stristr($login, "sbcglobal") ||stristr($login, "google")
)
{
$error .= "Your username cannot be an email address.<br>\n";
}
// check for other forbidden words in username
if (
stristr($login, "69") ||
stristr($login, "420") ||
stristr($login, "sex") ||
stristr($login, "jock") ||
stristr($login, "yoni") ||
stristr($login, "jesus") ||
stristr($login, "fuck") ||
stristr($login, "stoner") ||
stristr($login, "bone") ||
stristr($login, "tryst") ||
stristr($login, "hummer") ||
stristr($login, "uncut") ||
stristr($login, "xxx") ||
stristr($login, "sensual") ||
stristr($login, "release") ||
stristr($login, "bottom") ||
stristr($login, "twink") ||
stristr($login, "sex") ||
stristr($login, "tant") ||
stristr($login, "inches") ||
stristr($login, "pussy") ||
stristr($login, "bj") ||
stristr($login, "eros") ||
stristr($login, "beejay") ||
stristr($login, "cock") ||
(stristr($login, "stud") && !stristr($login, "student"))
)
{
$error .= "Your username contains a word, partial word, characters or phrase that is not allowed!<br>\n";
}
