Re: Verifying encrypted password from MySQL database with PHP

From: Date: Thu, 06 Mar 2003 05:35:14 +0000
Subject: Re: Verifying encrypted password from MySQL database with PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138416@lists.php.net to get a copy of this message
On Thursday 06 March 2003 13:21, Chinmoy Barua wrote: > I have an user table where the username and passwords of the users are > stored. The passwords are stored in encrypted format (the MySQL function > 'ENCRYPT($password) is used for insertation). > > Now I want to varify username and password. For that, I have written the > followin PHP code: > > --------------------------------------------------------------------------- >------------------ N.B.: " $flogin " is a veriable which store username from > a HTML form. & "$fpass " is a veriable which store password from a HTML > form. > > > > $query="SELECT UserName, Attribute, Value FROM radcheck WHERE > UserName='$flogin Try: SELECT UserName, Attribute, Value FROM radcheck WHERE UserName='$flogin' AND PasswordField = ENCRYPT('$fpass') -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* The part of the world that people find most puzzling is the part called "Me". */

« previous php.general (#138416) next »