php-db | 2001072
Date: 07/26/01
- Next message: god <email protected>: "[PHP-DB] How to LogOut?"
- Previous message: Paul Burney: "Re: [PHP-DB] Retrieving Rows - Can I Change The Order?"
- In reply to: Jordan: "Re: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?"
- Next in thread: JD Daniels: "RE: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
Thank you to everybody who answered my question.
Unfortunately, I don't use classes in my php.
Here is the solution I actually used :
----------------------------------------------
----------------------------------------------
// Generate new line for username + modified password
$line = read_cgi("username").":".crypt(read_cgi("password"))."\n";
// opens a temp file
$pass_file_tmp = fopen(PASS_FILE_TMP,"a");
// reads actual password file
$fcontents = file(PASS_FILE);
while ( list( $numero_ligne, $ligne ) = each( $fcontents ) )
{
if (!ereg(read_cgi("username"),$ligne))
{
fwrite($pass_file_tmp,$ligne);
}
}
// add new password of the selected user
fwrite($pass_file_tmp,$line);
// deletes the old passwd file and replaced by the new one
rename(PASS_FILE_TMP,PASS_FILE);
----------------------------------------------
----------------------------------------------
Regards,
-- Samuel Torton NCSLab.com-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: god <email protected>: "[PHP-DB] How to LogOut?"
- Previous message: Paul Burney: "Re: [PHP-DB] Retrieving Rows - Can I Change The Order?"
- In reply to: Jordan: "Re: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?"
- Next in thread: JD Daniels: "RE: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

