HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default [PHP] Best way of "casing"?

    How would I stop users registering the same name but within different casing.

    I've done it on Nivade, but I don't think I'm using the best way, the way I'm usnig is changing the username (in registration) to lowercase with strtolower then echoing ucwords which changes them to uppercase, but shift key rapes.

    What way is the best, or is this the only way?

    Moved by lAscend (Forum Super Moderator): From Designing & Development. Please post in the correct section next time.
    Last edited by lAscend; 19-08-2008 at 06:32 PM.

  2. #2
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    I use mysql_num_rows and that works fine?

    PHP Code:
    $checkname mysql_query("SELECT username FROM users WHERE username='$username'");
    $checknamemysql_num_rows($checkname);
    if(
    $checkname>0){
    echo 
    'This username is currently in use!'
    Works fine and it doesn't matter if one is all in lowercase, uppercase etc? or at least it certainly works fine for me?

    Sorry if this isn't what you mean!
    Last edited by Johno; 19-08-2008 at 06:10 PM.

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    For my site I have 2 rows, 1 called username which is there username as they typed it when they signed up (case sensative) and the other is called usernameid and it is there username capitalised (use strupper()). It makes it a lot eaysier to stop duplicate usernames then.
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Mar 2008
    Posts
    5,107
    Tokens
    2,809

    Latest Awards:

    Default

    I just do the same way Johno does, never allows duplicates.

  5. #5
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    @ Dentafrice / Johnno!

    I'd usually close it with the curly bracket.. if I was you then.

  6. #6
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    Well yeah of course lol

    Just copied it straight from something I was working on so I left out the:

    PHP Code:
    } else { 
    But yeah lol

Posting Permissions

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