Re: php3 case sensitivity
| From: | Brian Clark | Date: | Mon, 07 Aug 2000 11:17:54 +0000 |
| Subject: | Re: php3 case sensitivity | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10449@lists.php.net to get a copy of this message | ||
M.vanderMerwe@expro.shell.co.uk wrote:
Hi guys, I asked this question last time as well, but didn't include the appropriate code to be checked. I have a problem whereby people can log in using upper or lowercase letters and I can't figure out why. I'm including pseudo-code of the problem. In this case I've added in code to check what happens. ================================================= else if (isset($PHP_AUTH_USER)) { // If non-empty, check the database for matches connect to MySQL mysql_connect( "localhost", "sqluser", "sqlpassword")If I'm not mistaken, try making the username column/field type in the database set to BLOB instead of VARCHAR (or whatever you have it set to). I think BLOB is case-sensitive and VARCHAR isn't. Try it and see.. Brianor die ( "Unable to connect to database.");// select database on MySQL server $db = mysql_select_db( "database") or die ( "Unable to select database."); // Execute the query and put results in $result $result = mysql_query( "SELECT * FROM ourdatabasetableWHEREusername='$PHP_AUTH_USER'",$db);