I have a working Insallation of this howto: http://www.howtoforge.com/virtual_po...er_ubuntu_edgy
Well, I want to provide to the users a simple Webinterface to change their passwords. So I began to wrote a PHP-Script. To verify the logins I first execute this Statement:
SELECT * FROM users WHERE (email='$email') AND (password=ENCRYPT('$pass'))
The login always fails and I know why: Here a quote from the MySQL manual
Encrypts str using the Unix crypt() system call and returns a binary string. The salt argument should be a string with two characters. If no salt argument is given, a random value is used.
When I execute the following statement several times, then I get each time another value
SELECT ENCRYPT( 'mysecretpassword' );
Now the question: What is the right "salt" Value to get always the same output as the system crypt() function?
thanks for help & greets