limitphp Posted November 13, 2008 Share Posted November 13, 2008 The username field for sites (digg, gmail, hotmail, amazon), is there a standard max length the field should be? no longer than _____ characters? I assume it should be a type varchar and whatever max length you set in the databse should also be set in the <input type=text> tag as well? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/ Share on other sites More sharing options...
flyhoney Posted November 13, 2008 Share Posted November 13, 2008 I've seen anywhere from varchar(32) to varchar(60). It really depends on the design of your site and how long names should be to not break the design. Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/#findComment-689473 Share on other sites More sharing options...
laffin Posted November 13, 2008 Share Posted November 13, 2008 ya might have to check rfc's for max username lengthj for emails. but different systems.... use different lengths Dug this up Following are the requirements for an e-mail address, with relevant references: 1. An e-mail address consists of local part and domain separated by an at sign (@) character (RFC 2822 3.4.1). 2. The local part may consist of alphabetic and numeric characters, and the following characters: !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } and ~, possibly with dot separators (.), inside, but not at the start, end or next to another dot separator (RFC 2822 3.2.4). 3. The local part may consist of a quoted string—that is, anything within quotes ("), including spaces (RFC 2822 3.2.5). 4. Quoted pairs (such as \@) are valid components of a local part, though an obsolete form from RFC 822 (RFC 2822 4.4). 5. The maximum length of a local part is 64 characters (RFC 2821 4.5.3.1). 6. A domain consists of labels separated by dot separators (RFC1035 2.3.1). 7. Domain labels start with an alphabetic character followed by zero or more alphabetic characters, numeric characters or the hyphen (-), ending with an alphabetic or numeric character (RFC 1035 2.3.1). 8. The maximum length of a label is 63 characters (RFC 1035 2.3.1). 9. The maximum length of a domain is 255 characters (RFC 2821 4.5.3.1). 10. The domain must be fully qualified and resolvable to a type A or type MX DNS address record (RFC 2821 3.6). 64 chars Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/#findComment-689478 Share on other sites More sharing options...
premiso Posted November 13, 2008 Share Posted November 13, 2008 I personally max all mine out at 25. For my purposes there is usually never a reason for a username to be longer than that other than spamming reasons. Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/#findComment-689481 Share on other sites More sharing options...
laffin Posted November 14, 2008 Share Posted November 14, 2008 I'm at around 30 cheracters for my projects. but yer right most ppl choose usernames that are around 5-10 chars, and 25/30 may be excessive as well. Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/#findComment-689842 Share on other sites More sharing options...
corbin Posted November 14, 2008 Share Posted November 14, 2008 I usually stick with either 16, 20, 24, 32, or 64. Just depends on what I expect the usual username to be. Quote Link to comment https://forums.phpfreaks.com/topic/132595-is-there-a-standard-max-length-for-a-username-field/#findComment-689857 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.