|
|
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 | |||
Hi,
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,
-!DraXxuS!-
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,
-!DraXxuS!-
Mon May 23, 2005 New Discussion
Found this site on the web. I use one very similar too it think you find it is what you need. http://www.custom-cgi.com/free/cookie_login/ I just started to experiment with it so I can tell you much about it.
Tue Aug 23, 2005 New Discussion
Difficult to solve your problem, I think!
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
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
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
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[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
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
Wed Oct 26, 2005 New Discussion
[note=jipman]
Topic started at 23 may, and still no reply from the topic starter. I think it's justified to close this one down.
[/note]
Topic started at 23 may, and still no reply from the topic starter. I think it's justified to close this one down.
[/note]
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
|
Index




