Re: MySQL PASSWORD() Question

From: Date: Tue, 27 Aug 2002 17:19:46 +0000
Subject: Re: MySQL PASSWORD() Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-114269@lists.php.net to get a copy of this message
cheers "Richard Lynch" <rich@phpbootcamp.com> wrote in message news:php.general-114190@news.php.net... > >If I insert a row's field's value using the PASSWORD() function, will I need > >to use it or another function to find that row using the same field? > > You'll need to do this when somebody tries to log in later: > > <?php > $username = $_POST['username']; # Or $PHP_AUTH_USER or $_GET['username'] > or ... > $password = $_POST['password']; # Or $PHP_AUTH_PW or $_GET or ... > $query = "select whatever from users where username = '$username' and > password('$password') = password"; > ?> > > In other words, you can *NEVER* "go backwards" from the password() function > output to get the original back. But you can call password() on some > incoming data and see if the two outputs match. > > -- > Like Music? http://l-i-e.com/artists.htm >

« previous php.general (#114269) next »