Forum Moderators: coopster
For example, John sets up a username with the username John.
I want it so that no one else can be john, jOHN, JoHn, etc. Also, when John logs in, I want him to be able to type in john, jOHN, etc. and be able to log in.
When he does log in, it will display the username how he originally set it up, John. Info is stored in a MySQL database. Any ideas?
Then in your login script when you compare the username they entered into your form, with your MySQL table you can use lower case on both , just for comparison so like
$username=mysql_real_escape_string($_POST['username']);
$password=mysql_real_escape_string($_POST['password']);
$username=strtolower($username);
$sql="SELECT * FROM yourTable where LOWER(username)='$username' and password='$password'";
so this way they will be able to enter their username in any case and still be able to login and yet when they are logged in it will be displayed in the original case as they entered.
Similarly on your add user script you can check mysql for same existing username with strtolower() and LOWER()
Hope it helps