Re: $PHP_AUTH_USER

From: Date: Fri, 18 Aug 2000 16:44:46 +0000
Subject: Re: $PHP_AUTH_USER
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-12499@lists.php.net to get a copy of this message
Thys, It's not that $PHP_AUTH_USER is case sensitive or not, its that mysql is case insensitive by default on matches. When you create your table you need to set the username/password fields as BINARY. Or you can alter your table with a command such as: alter table member modify user varchar(40) binary not null default ''; which will then make matches on the field user case sensitive. Hope this helps. -- Dominic M.vanderMerwe@expro.shell.co.uk wrote: > > Is $PHP_AUTH_USER case sensitive? > > I've had people sign in using lowercase names when they are registered > in the database with varying upper and lower letters and although they > are signed in they can't edit things. This is good, but how can I > prevent them from being able to log in at all if they don't use the > username they specified? > > BTW. I'm using the HTTP scenario as many of them have cookies switched > off. > > Part of the code: > if (!isset($PHP_AUTH_USER)) > { > // If empty, send header causing dialog box to appear > header('WWW-Authenticate: Basic realm="FGN Members Area"'); > header('HTTP/1.0 401 Unauthorized'); > exit; > } > > The rest is just a validation of $PHP_AUTH_USER and $PHP_AUTH_PW aainst > entries in a MySQL members database. > > Thanks > > Thys > > ------------------------------------------------------------------------ > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#12499) next »