Jump to content


Photo

Username problem


  • Please log in to reply
6 replies to this topic

#1 Tucker

Tucker

    Member

  • Member
  • PipPip
  • 55 posts
  • Location:Sydney - Australia
  • Interests:Travel, Airplanes, Acting, Astronomy, Science, Music, Computing and etcetera.
  • SourceForge IDzypherone

Posted 02 May 2007 - 07:30 AM

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?

#2 kalpz

kalpz

    Beta Team Member

  • Beta Tester
  • PipPip
  • 132 posts
  • Location:New Zealand
  • IRC Nickname: LifeSteala
  • Main OS: Windows Vista

Posted 03 May 2007 - 12:42 AM

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/

#3 Tucker

Tucker

    Member

  • Member
  • PipPip
  • 55 posts
  • Location:Sydney - Australia
  • Interests:Travel, Airplanes, Acting, Astronomy, Science, Music, Computing and etcetera.
  • SourceForge IDzypherone

Posted 04 May 2007 - 11:17 PM

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.

#4 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 06 May 2007 - 06:13 AM

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.n...g...xe

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:

#5 kalpz

kalpz

    Beta Team Member

  • Beta Tester
  • PipPip
  • 132 posts
  • Location:New Zealand
  • IRC Nickname: LifeSteala
  • Main OS: Windows Vista

Posted 06 May 2007 - 04:21 PM

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/

#6 Tucker

Tucker

    Member

  • Member
  • PipPip
  • 55 posts
  • Location:Sydney - Australia
  • Interests:Travel, Airplanes, Acting, Astronomy, Science, Music, Computing and etcetera.
  • SourceForge IDzypherone

Posted 06 May 2007 - 05:30 PM

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

#7 olajideolaolorun

olajideolaolorun

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 2,347 posts
  • Gender:Male
  • Location:Atlanta, GA
  • SourceForge IDempirex
  • Wiki ID: olajideolaolorun
  • IRC Nickname: Olajide
  • Main OS: Windows 10

Posted 08 May 2007 - 07:58 PM

:lol:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users