Password Reminder And Password Change .htaccess - I need a script to change password
Discussion by potnuru with 4 Replies.
Last Update: October 27, 2005, 7:55 am
I use .htaccess to protect the members area of my site. I use a script called register.pl (search hotscripts and you'll see it) This script takes the username and password provided by the user and then enters the username and the encrypted password into the password file.
What I want to do is, along with the username and password being taken, I want to also take the email address and when the user forgets his/her password all he has to do is type in the email, and the password will be sent.
Thanks in advance,
Mon May 23, 2005 New Discussion
Tue Aug 23, 2005 New Discussion
Perhaps it's easier if you work with mySQL, the name and password are put in the password-file and in the same script, the name, passwort and entered e-mail are saved in your database!
If anyone lost his password, you can easier use your database to (re)send the password than the htacces-password-file!!
Aditionally, i don't think that youre able to put anything else except the name und encryptet password in htaccess-pwd-file!!
Correct me, if I should be wrong...
Sorry for my probably bad english, but I'm from germany
Tue Oct 18, 2005 New Discussion
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
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
$theline = explode(" ",$userfile[$x=8]); // there are always three spaces (" ") in a line
$user = $theline; // the user name
$password = $theline; // 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!
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!
Wed Oct 26, 2005 New Discussion
Topic started at 23 may, and still no reply from the topic starter. I think it's justified to close this one down.
Thu Oct 27, 2005 New Discussion
|I Need Help With .htaccess To Create A Login Form I need help with .htaccess to create a l (0)||(4) Strange Perl Behavior|