Re: MySQL PASSWORD() Question

From: Date: Mon, 26 Aug 2002 22:51:45 +0000
Subject: Re: MySQL PASSWORD() Question
Groups: php.general 
Request: Send a blank email to php-general+get-114190@lists.php.net to get a copy of this message
>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 (#114190) next »