Jump to content

Username capitalization (SPLIT FROM: Allowable Characters for Username?)


phppup

Recommended Posts

While we're on the subject, is there a way to ensure that the first letter of a name is captalized, and the rest lowercase?  Or is this best handled later on, when the name is being used and called from the DB.

 

PS: some of us comment are code as to WHAT we are doing because we're just not that good yet, and we need to explain it to ourselves.

Link to comment
Share on other sites

I might want it capitalised so that when I send an email, it can be addressed "Dear Greenballoon" as opposed to greenballon.  So, is there a way to do it, or it it best left until I send the email.

 

But the username the user picked is greenballoon, not Greenballoon.

Link to comment
Share on other sites

I agree with Pikachu2000. Forcing capitalization on user names is a bad idea. This could end up causing a lot of problems down the road. People select their user names knowing that it is case-sensitive. Why would you mess with that, even in an email salutation? Many times I have forgotten what user name I used for a particular site, and copy-pasted it from an email I received from that site. If I got denied access, I would think it was because of a password issue, not username. Yeah, bad idea.

Link to comment
Share on other sites

ucfirst doesn't do anything to any character other than the first one. You'd have to first strtolower the string. And if you do that, then what happens to the person whose username is MacDonald_II? Do you see why there are far more reasons not to do this than there are to do it?
Link to comment
Share on other sites

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.