Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.