Suggesting available username

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have to show some of the posible usernames available when a user can
not get a perticular username in a very normal member registration

I will be thankful if anyone can show me a way to this.

Jaunty Edward

Re: Suggesting available username

Quoted text here. Click to load it

1.  Make up some similar user names to what the user asked for.
2.  Check these against the list of taken user names, eliminating
    the ones already taken.
3.  Present the list to the user.

Some similar user names include:

- append a digit to what the user asked for.
- change one letter in what the user asked for
- change a substring that corresponds to a name to a similar name
  e.g. CharlesH -> CharlieH.  This requires a known list of similar
  names to make it work.
- Possibly try a combination of several of the above.

You do have to make sure your suggestions don't run over the length
limit for a user name, that they contain only legal characters, and
possibly screen your suggestions for swear words.

                    Gordon L. Burditt

Re: Suggesting available username (Jaunty Edward) wrote in message
Quoted text here. Click to load it

   1. make the username field UNIQUE.
   2. Insert the new username in the table.
     a. if no duplicate error, then no problem. Continue the
     b. if there is duplicate error, fetch similar usernames from the
table. "SELECT username FROM user_info WHERE username='$newusername'".
Now you have array of similar usernames.
     c. Call GenUsernames() function which appends user's DOB, DOJ,
etc but excludes the names in similar usernames list. Done.

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com

Site Timeline