PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
No. You've given an example of an acceptable username, and an example of an unacceptable username. You've not explained what the format should be though.
That's like me saying to you, the answer to a sum is 5, and not 4. What's the sum?
// word in username too long?
$too_long_word = too_long_word($new_user_name,$settings['name_word_maxlength']);
if($too_long_word) $errors[] = 'error_word_too_long';
// look if name already exists:
$name_result = mysql_query("SELECT user_name FROM ".$db_settings['userdata_table']." WHERE lower(user_name) = '".mysql_real_escape_string(my_strtolower($new_user_name, $lang['charset']))."'", $connid) or raise_error('database_error',mysql_error());
if(mysql_num_rows($name_result)>0) $errors[] = 'user_name_already_exists';
mysql_free_result($name_result);
djdubuque wrote:Can this be changed to include what I'm asking?
Yes it can. But we can't help you because no one can understand what you want it to do. Please explain your requirements. What is a "good" username and what is a "bad" username? Your examples don't tell us anything.