Caps Sensitive

Hello i am having a problem with my code. The code is part of a php login auth which detects if username and password from form match the database. The problem is username is case sensitive how can i change it so its not case sensitive:

elseif ( $act == “authmember” ) {

$membername=$_POST[‘membername’];
$memberpassword=$_POST[‘memberpassword’];

$query2 = mysql_query("SELECT * FROM member WHERE UserName=‘$membername’ ")
or die("Could not insert data because ".mysql_error());
$qry2 = mysql_fetch_array( $query2 );

if ( $membername == “$qry2[UserName]” AND $memberpassword == “$qry2[Password]” ) {
echo “login will work”;
}
else
{
echo “not working $membername and $memberpassword”;
}

}

make the strings lowercase $membername= strtolower($_POST[‘membername’]);
same with the password.

Thanks for the fast reply,

Just another question i am getting this error:

Parse error: syntax error, unexpected T_LOGICAL_OR in /home/chatpoin/public_html/~advanced/login.php on line 33

this is line 33:

if( !($qry2[‘UserName’]) ) OR ( !($qry3[‘UserName’]) ) {

Is there another word instead of OR i can use for this statement?

its the way its written thats not quite right.

if(!$qry2['UserName'] OR !$qry3['UserName']) {

also be very careful of using OR instead of || . They do not have the same level of precedence.

:tup: see http://php.net/manual/en/language.operators.logical.php