[nycphp-talk] Usernames with whitespace
Mark Armendariz
lists at enobrev.com
Thu Aug 4 21:52:18 EDT 2011
I believe WHERE/= in MySQL is case insensitive. If you want
case-sensitive conditions, you'll want to use WHERE BINARY field LIKE
'data' or the documentation-preferred WHERE COLLATE latin1_general_cs
LIKE 'data'. Important to keep in mind if you're rolling your own
authentication.
Reference: http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html
Mark
On Mon, Aug 1, 2011 at 9:04 AM, federico ulfo <rainelemental at gmail.com> wrote:
> Use case insensitive field or execute query with "lowercase"
>
> SELECT * FROM table WHERE LOWERCASE( $name ) = LOWERCASE( name )
>
> Depends by your goal, I could let user insert space and case only for
> personal informations as name, address and such, not necessary on
> login, unless you need higher security.
>
> My 2 morning cents :)
>
> Sent from my iPhone
>
> On Aug 1, 2011, at 8:43 AM, Anthony Wlodarski
> <anthony at tinkertownlabs.com> wrote:
>
>> If you were to allow spaces in the user name I would force them all to lower case (avoid duplicates if properly spaced). However collapsing spaces is an idea I would not even entertain to use. "John Foobar" vs. "John Foobar" is something that is always prone to errors if a user has to input their name into a text field. You could also break the input elements into a first name and last name fields. When you go to display that information then you can properly insert the spaces.
>>
>> On 07/30/2011 06:48 PM, Mutaz Musa wrote:
>>> Hi folks,
>>> What are your thoughts on allowing usernames with spaces, e.g. "john
>>> smith". They're often disallowed and I was wondering on your thoughts
>>> as to why that might be.
>>> One reason I can think of is to avoid confusingly similar usernames,
>>> e.g. "john smith" and "john smith" (2 spaces)
>>> In those cases wouldn't collapsing multiple spaces into a single space
>>> be a more conservative solution than disallowing the character
>>> entirely?
>>>
>>> Mutaz
>>> _______________________________________________
>>> New York PHP Users Group Community Talk Mailing List
>>> http://lists.nyphp.org/mailman/listinfo/talk
>>>
>>> http://www.nyphp.org/Show-Participation
>>
>> --
>> Anthony Wlodarski
>> Lead Software Engineer
>> Get2Know.me (http://www.get2know.me)
>> Office: 646-285-0500 x217
>> Fax: 646-285-0400
>>
>> _______________________________________________
>> New York PHP Users Group Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> http://www.nyphp.org/Show-Participation
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>
More information about the talk
mailing list