The password function you are using is used in the mysql authentication table. If I remember right it notes in the manual not to use it for your own apps.
The password() function is a one way encryption, meaning you'll be unable to display the password in plaintext again unless someone enters the password and you use the unencrypted login password. If you intend to go that route (which isn't exactly secure) use MD5() or SHA() encryption.
Your other option is to use the encrypt() function which will allow you to convert both directions. The PHP equivalent is crypt().
It has two arguments, the password and a keystring. You'll need the keystring to be the same at all times.
Here is an example for php:
http://127.0.0.1/?pass=hrm
<?
$crypted = crypt($pass,"test");
$decrypted = crypt($crypted,"test");
print "Crypted pass: $crypted";
print "Decrypted pass: $decrypted";
?>
Hope this helps!
-Kaz