How should we match exact letters means(lowercase==lowercase)or(UPPERCASE==UPPERCASE) or(lowercaseUPPERCASE==lowercaseUPPERCASE) while checking for password
for eg. abc=ABC(must not be allowed) abc=aBc(must not be allowed) only abc=abc must be allowed
i want to match the words by cases
but in my site if user pswd is abc and he enter ABC he can easily enter to his control panel
So plz help me in this regard
I m using PHP
Thanking you in advance
checking letter case using php
Moderator: General Moderators
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
You could convert all submitted data to lowercase or uppercase.
It would make sense to convert their password to lower case when they first created a password or else you'll end up with users being unable to login.
Code: Select all
$password = strtolower($_POST["passwordbox"]));try using http://hr.php.net/manual/en/function.md5.php when inserting passwords into database. In login form also convert posted value into md5 and then compare it from db
result of hash md5 is not the same for 'password' and 'PASSWORD', and security of braking the users password is more secure.
eg:
hope I've helped you
regards ddragas
result of hash md5 is not the same for 'password' and 'PASSWORD', and security of braking the users password is more secure.
eg:
Code: Select all
$username=$_POST['username'];
$password=md5($_POST['password']);
$result = mysql_query("
select username, password
from mytable
where username = '$username'
and password='$pasword'
") or die (mysql_error());regards ddragas