Page 2 of 2

Re: How to force username format?

Posted: Sun Sep 13, 2009 8:48 am
by djdubuque
jackpf wrote:
What are these "requirements"? What have you tried?
They seem like pretty self explanatory questions to me....

Does this not explain the requirements?
if username = xyz123 then continue
if username = xyzabc then echo "this username does not conform to this forums registration requirements!

Re: How to force username format?

Posted: Sun Sep 13, 2009 8:49 am
by jackpf
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?

Re: How to force username format?

Posted: Sun Sep 13, 2009 9:55 am
by djdubuque

Code: Select all

// 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);
Can this be changed to include what I'm asking?

Re: How to force username format?

Posted: Sun Sep 13, 2009 10:16 am
by Eric!
This is the best thread ever.
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.

Re: How to force username format?

Posted: Sun Sep 13, 2009 10:21 am
by superdezign
Google Regular Expressions and leave us be.

Re: How to force username format?

Posted: Sun Sep 13, 2009 10:30 am
by jackpf
Innapropriate -- Removed by Jcart

Re: How to force username format?

Posted: Sun Sep 13, 2009 10:45 am
by djdubuque
jackpf wrote:nnapropriate -- Removed by Jcart

If you have nothing to contribute to this discussion, please leave your useless comments to yourself!

Re: How to force username format?

Posted: Sun Sep 13, 2009 10:46 am
by superdezign
djdubuque wrote:
jackpf wrote:Innapropriate -- Removed by Jcart

If you have nothing to contribute to this discussion, please leave your useless comments to yourself!
The urge to say "likewise" to you is so tempting. >.>

Re: How to force username format?

Posted: Sun Sep 13, 2009 11:11 am
by jackpf
:yar:

Re: How to force username format?

Posted: Sun Sep 13, 2009 11:36 am
by John Cartwright
I knew I should have locked this previously. Locked.