Hello there,
I think it should be possible. You are trying to make up some connection between names and email addresses, right? Well, you can do this by corresponding line: for example
CODE
line 7:htpasswd -bc .htusers Toni one
line 8:htpasswd -bc .htusers Luigi two
line 9:htpasswd -bc .htusers Bernardo three
lline 10:htpasswd -bc .htusers Hernandez four
So if you just read in the .htusers file into an array like the PHP function "file()" You got them grouped by lines. So Mr. Luigi would be Nr. 8. If you now have a database with the emails in it or a textfile (would not recommend that), than you can just give the corresponding line numbers to the email address. So, if Mr. Luigi now tries to get his password send, you take his line number and email address from the database, open the .htusers file with file().. Wait it's easier in code
CODE
$userfile= file(".htusers");
$theline = explode(" ",$userfile[$x=8]); // there are always three spaces (" ") in a line
$user = $theline[2]; // the user name
$password = $theline[3]; // the users password
// email address you got from database. now you can send an email with this data, hope you know how that works. php.net/mail
Should do the job, but you will have to change it for your personal circumstances! Good luck!
regards,
Ruben
Oops, I assumed PHP! Sorry for the double post. I do not know perl at all, but I hope the Idea is clear! Sorry for the double post, may be a mod could edit? Thanks!
Ruben
Comment/Reply (w/o sign-up)