Jump to content
xisto Community
Sign in to follow this  
Paul

Password Reminder And Password Change .htaccess I need a script to change password

Recommended Posts

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!-

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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 oneline 8:htpasswd -bc .htusers Luigi twoline 9:htpasswd -bc .htusers Bernardo threelline 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
$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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.