Jump to content
MakeWebGames

Recommended Posts

Posted

Ok.. So I want to make usernames case senisitive. Just to prevent people from selecting similar username, and the imposing as someone else...

Currently only way to choose username is during registration.. I think relevant code is following:

if ($passed_verification==1)

{

require('jungtis.php');

$db_username=mysql_query("SELECT * FROM users WHERE username='$uname'");

$db_uname_check=mysql_num_rows($db_username);

 

if ($db_uname_check==1)

{

$taken_username="Username $uname is already taken. Please choose a different username!";

}

So if query returns any rows.. It will say that username is taken.

So if we say that my username is Vytas. and someone decided to register as vytas or VYTAS or VYtas etc etc..., that query will not return any rows, and user will be allowed to register. So what should i do? Regex? or maybe something to do with strpos???

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...