Jump to content

[SOLVED] username and case-sensitivity


Lodius2000

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/124026-solved-username-and-case-sensitivity/
Share on other sites

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']);

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.