Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Username problem

Featured Replies

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?

What are you building? Is it in PHP??

 

if ( $_REQUEST['username'] === "JoHn SmItH")

 

That would match EXACTLY in PHP.

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/

  • Author

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.

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

Oops, Sorry I misread your initial question. The code Ric posted is what you want.

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/

  • Author

Thanks, why did I not think of it sooner. Dah it was so obvious thanks for pointing that out to me :lol:

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.