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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]