note 34628 deleted from function.md5 by didou

From: Date: Sat, 02 Aug 2003 12:29:02 +0000
Subject: note 34628 deleted from function.md5 by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-53197@lists.php.net to get a copy of this message
Note Submitter: rizvi100@hotmail.com ---- The md5() function is very useful for Password encryption. Keep in mind that we can not Decrypt it. The most simplest method to use md5() function PHP with MySQL is as follows: Insert the record into the MySQL Database using a query like: $query = "INSERT INTO user VALUES ('DummyUser',md5('DummyPassword'))"; And then for matching the password use: $password = md5($password); $query = "SELECT * FROM user WHERE username='DummyUser' AND password='DummyPassword'"; In the above code you can use your Variables instead of DummyUser & DummyPassword. The length of the Password field in my DB is 60 char. Hope this helps!! :)

« previous php.notes (#53197) next »