Page 1 of 1

case sensitive

Posted: Fri Jan 05, 2007 10:06 pm
by mlecho
hi all...i have this bit of code to check passwords in a data base...however, neither the logon or pass checks are case sensitive...how can i do this with php?

Code: Select all

<?php
include("sqlConnect/localhost.php");
$pass_entry=$_POST['pass'];
$logon_entry=$_POST['logon'];
testLogon($pass_entry,$logon_entry);
function testLogon($pass_entry,$logon_entry){
	$table="users";
	$sql="SELECT * from $table WHERE username='".$logon_entry."'";
	$result=mysql_query($sql);
		while($row=mysql_fetch_row($result)){
			$userPassWord=$row[2];
			if($userPassWord==$pass_entry){
			echo ("good");
		}
	}
}

?>

Posted: Fri Jan 05, 2007 10:20 pm
by feyd
Your password check is case sensitive. The username would be if the field in the database was set to BINARY.