Retrieve a decrypted password for display? Can't do it, MySQL's password() 
function is one way. Check this page of  the MySQL docs:

You can display the password as encrypted by that function.

PHP doesn't have a password() function, that's a MySQL function, so your line
    <?php echo $myrow["userpass(password('userpass'))"]?>
won't work.

This isn't an altogether bad thing. There is a long-held belief that once 
passwords are set no one should be able to retrieve them, only reset them. 
This does make it very difficult to use the "users" table for mailing 
passwords to users. <g>

If you want to encrypt /decrypt passwords, have a look at the des_encrypt() 
and des_decrypt() functions on the above-referenced page.

If you want still more information on passwords there is a tutorial/article 
on line at

Regards - Miles Thompson

At 04:13 PM 1/19/2002 -0500, Shelly Wilds wrote:
>hi guys,
>  i'm new to php/mysql :), so plz bare with me a bit.
>i'm trying to figure out how to retrieve password un crypted to browser.
>        $result = mysql_query("SELECT * FROM auth WHERE 
> username='$valid_user'",$db);
>         $myrow = mysql_fetch_array($result);
>         ?>
>         <form method="post" action="<?php echo $PHP_SELF?>">
>         <input type="hidden" name="id" value="<?php echo $myrow["id"]?>">
>         Username:<input type="Text" name="username" value="<?php echo 
> $myrow["username"]?>"><br>
>         Userpass:<input type="Text" name="userpass" value="<?php echo 
> $myrow["userpass"]?>"><br>
>         Usermail:<input type="Text" name="usermail" value="<?php echo 
> $myrow["usermail"]?>"><br>
>         Userpriv:<input type="Text" name="userpriv" value="<?php echo 
> $myrow["userpriv"]?>"><br>
>         <input type="Submit" name="update" value="Update information"></form>
>i've tried this and no result...
>Userpass:<input type="Text" name="userpass" value="<?php echo 
>could someone plz help me out with this...    tx
>Send and receive Hotmail on your mobile device:
>PHP Database Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to