Results 1 to 4 of 4

Thread: PHP Username Suggestion

  1. #1
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Username Suggestion

    I wonder if someone could help.

    Im looking for some code to use (preferrablly php) wwhich will link t my MySql database.

    What i am trying to do:

    1. Someone enters their name, first and last.
    2. They create a username, for use on a site.
    3. The username is taken, so the page shows a few options that are available, which basially is a return mix of their first and last name and a random number.

    I suppose for an example, its a bit like the username suuggestions found on the ebay page.
    https://scgi.ebay.co.uk/ws/eBayISAPI...www.ebay.co.uk

    havlf way down, where you check availability of usernames and if taken a selection are automatically returned to the user.

    Anyone have any ideas, or can point me the right dirctio where i can find the code for this sort of thing??

    Would be greatly appreciated
    regards
    Neil

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I personally hate the suggestions. They just don't ever fit what I want.

    It's not that complex, in theory.

    I think the best way is to general a name... like...
    $suggestion = $first.$last.rand([params]);

    that would give you something like johnsmith42

    then you would want to check that against a database to see if it too was taken.

    There are various ways you could rearrange the name.

    I would also consider using their first choice username to generate a suggested username as opposed to using their actual name, since that is likely to be closer t what they want.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi,
    Thanks

    Is there anywhere i might find an example of this working, in code?

    Regards
    Neil

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's very specific overall.

    How does it interact with the database, for example?

    Post the code you have and we could help you include this step in it.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •