Lodius2000 Posted September 13, 2008 Share Posted September 13, 2008 howdy folks how can i make my username for my login caseinsensitive. I know how to user strtolower but that would require that my db holds a lowercase entry, my username is capitalized on the first letter but for ease of typing when logging in i would like to use all lower, but that doesnt match the db so it wont let me in ie Jeff (in db) is not the same as jeff (trying to log in with this) but i need Jeff to stay capitalized because it is going to be the username used for the comments, and I dont want to use a lowercase only username.... do I have to have a separate column in my db? confused yet? help Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/ Share on other sites More sharing options...
Maq Posted September 13, 2008 Share Posted September 13, 2008 If you do $string=strtolower($string); it should store all lower case. But if it doesn't for some reason then everytime you take it out of the data base, make it lower. Example: $string = strtolower($data['user_name']); Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/#findComment-640317 Share on other sites More sharing options...
Lodius2000 Posted September 13, 2008 Author Share Posted September 13, 2008 but that is my point, i use my username as my comment sig, and i dont want to be jeff to the world, I want to be Jeff Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/#findComment-640323 Share on other sites More sharing options...
Maq Posted September 13, 2008 Share Posted September 13, 2008 So when you extract it for comparing then use strtolower() if not then use it as it's stored. Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/#findComment-640329 Share on other sites More sharing options...
Stryves Posted September 13, 2008 Share Posted September 13, 2008 but that is my point, i use my username as my comment sig, and i dont want to be jeff to the world, I want to be Jeff So it's Jeff in the DB, but when posted it changes to jeff? Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/#findComment-640331 Share on other sites More sharing options...
Lodius2000 Posted September 13, 2008 Author Share Posted September 13, 2008 Maq, groooooooaaaan, why didnt I THINK OF THAT // hates self thanks its late for those who want to know i log in using anything jeff Jeff JeFf but in the db it is stored as Jeff so strtolower($_POST['username']) and strtolower($db_stored_username) they match, now it doesnt matter what is in the db or what i typed in, they match, SO when you register, you had better type it like you like it SOLVED Quote Link to comment https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/#findComment-640334 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.