Question about Register

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
I completely forgot how to do it but how would I go about implementing a thing into the register where if the name they decided contains something like MOD- etc it would tell them they can't use that?
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
1) In the class.users file find the register code and add a new if statement and create a new function called something like "containsIllegalWords"

2) Setup the method with an array, and loop through the array to see if the string you sent containsIllegalWords contains any element of the array.

[Yes] -> return true
[No] -> return false

if(!containsIllegalWords['post_username']){
//other code



}else{
$err = 'Sorry, you can not use that username';
}
 

Users who are viewing this thread

Top