faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 22 people (59%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

how do i compare and check the user input password from form with encrypted one in the Apache htaccess password file

Jul 19th, 2004 23:22
Alder Rus, Matt Gregory, Nikhil Mehta, http://www.directoryonclick.com , http://www.singapore-yellow-pages.com


The .htpasswd file containes users in a linear list as shown below
<username>:<encrypted-password><cr> where <cr> is carriage return.
In order to compare the encrypted-password to your user-entered 
information you must first encrypt the password using the mcrypt 
function.
Remember that you cannot decrypt the encrypted information in 
the .htpassword file.  (at least not easily :) )