• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Limit number words nickname

I use the site below and would like to limit the number of words a nickname can contain. I don't know exactly which checks should be inserted and in which files.

Can be wrong, but looks like here:

or here:

or even both!
 
Can be wrong, but looks like here:

or here:

or even both!
I have the same codes, but I still manage to create nicknames with 5 words.
 
cause the minimum is five

Five letters, not words.

PHP:
if (empty(strlen($newchar_name) >= 5))
$newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';

In the ajax file there is a supposed check that prevents creation with more than 3 words, but I don't know why it doesn't work.

 
Five letters, not words.

PHP:
if (empty(strlen($newchar_name) >= 5))
$newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';

In the ajax file there is a supposed check that prevents creation with more than 3 words, but I don't know why it doesn't work.

I think ajax doesnt work here. call for gesior help
Post automatically merged:

Five letters, not words.

PHP:
if (empty(strlen($newchar_name) >= 5))
$newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';

In the ajax file there is a supposed check that prevents creation with more than 3 words, but I don't know why it doesn't work.

Or try that(i dont know if works):

if player name has more than two words, send warning.
paste below
if (empty(strlen($newchar_name) >= 5))
$newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';

PHP:
if (str_word_count($newchar_name) > 2)
$newchar_errors[] = 'Please enter a name for your character with up to 2 words.';
 
Last edited:
I think ajax doesnt work here. call for gesior help
Post automatically merged:


Or try that(i dont know if works):

if player name has more than two words, send warning.
paste below
if (empty(strlen($newchar_name) >= 5))
$newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';
PHP:
if (str_word_count($newchar_name) > 2)
$newchar_errors[] = 'Please enter a name for your character with up to 2 words.';
The last suggestion worked. Thanks!
 
Back
Top