Tucker Posted May 2, 2007 Report Share Posted May 2, 2007 I am trying to figure out a way so i can allow people to use their username with the worry of caps lock on. any suggestions? Quote Link to comment Share on other sites More sharing options...
kalpz Posted May 3, 2007 Report Share Posted May 3, 2007 What are you building? Is it in PHP?? if ( $_REQUEST['username'] === "JoHn SmItH") That would match EXACTLY in PHP. Quote ATOMIC Web Hosting 2007 - 2011 Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail) E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/ Link to comment Share on other sites More sharing options...
Tucker Posted May 5, 2007 Author Report Share Posted May 5, 2007 oh sorry yes. i am making a new site and i am trying to make it so people can use the username without the worry of case sensitivity. Ie, someone types tuCker and can loging it with that matches tucker. Quote Link to comment Share on other sites More sharing options...
Ric Posted May 6, 2007 Report Share Posted May 6, 2007 The caps lock key is a real pain. For home users why not turn it into something that is more useful. Take a look at ClipControl turns that caps lock key into a clipboard control key. http://sourceforge.net/project/downloading...xe&47440710 Additional information:http://clipcontrol.anticapslock.com/ The ideal solution would be to disable the key using PHP; a user visiting your site would not then have this problem. The bottom line, you cant in any version of PHP or in future versions (security risk). If a user accidentally hits the caps lock key that person will have problems not only entering a user name but also a password and any forms they fill in. I mention passwords because ideally these contain both upper and lowercase characters along with digits (security). Mixed case characters in a name are easy to handle just convert all characters to either upper or lower case and then perform a comparison. You can do the same with a password (note this reduces security). I have assumed you just want to do this for web pages and not server access. If this is the case you need to use something similar to this: Save as form.html <html> <head> <title>Test form</title> </head> <body > <p>Please enter your name<p/> <form action="check.php" method="post" > User Name: <input type="text" name="Name" value="Mike SmITH" /> <p>Calls page check.php</p> <input value="Enter" type="submit"> </form> </body> </html> Save as check.php <html> <head> <title>Check</title> </head> <body > <? $some_name = $_REQUEST['Name']; //read name $upper_case_name = strtoupper($some_name); // convert to upper case echo "Your name is : <b> $some_name</b><br>"; echo "Your name is : <b> $upper_case_name</b><br>"; if($upper_case_name == "MIKE SMITH"){ echo "Your name is valid welcome<br>"; } else{ echo "Your name is invalid!!!<br>"; } ?> <p><a href="form.html">Back to form page form.html</a></p> </body> </html> The above is just an example what you use depend on the application. It will not resolve the form-filling problem. Quote Link to comment Share on other sites More sharing options...
kalpz Posted May 6, 2007 Report Share Posted May 6, 2007 Oops, Sorry I misread your initial question. The code Ric posted is what you want. Quote ATOMIC Web Hosting 2007 - 2011 Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail) E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/ Link to comment Share on other sites More sharing options...
Tucker Posted May 6, 2007 Author Report Share Posted May 6, 2007 Thanks, why did I not think of it sooner. Dah it was so obvious thanks for pointing that out to me Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted May 9, 2007 Report Share Posted May 9, 2007 Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment 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.