How do I not allow people to make usernames with alt codes in them?
How do I not allow people to make usernames with alt codes in them?
Something like this maybe?Code:if (preg_match("/^[a-zA-Z0-9._]{3,15}$/", $username)) { [...] } else { $msg = 'There are invalid characters in your username, please check it!'; }
OR
Greez,Code:$filter = preg_replace("/[^a-z\d\-=\?!@:\.]/i", "", $name); [...] }elseif($filter !== $name){ $msg = "The special characters are disabled.";
Because you have to edit it..
can you post your register please ;p
Here i have made a fast code for you:
This is the best way to secure it.PHP Code:$filter = preg_replace("/[^a-z\d\-=\?!@:\_]/i", "", $name);