how can user retreive his password if he forget his password ?
any idea or any code you refer.... or tutorials ?
and next question is......
when user registered then one mail send to his email address which he provide during registration... .
and activation link sent to him and when he click on actigviate link then his registration should activate...
please help me...!
Comments
Chances are, you're using MD5 to generate the password in a PHP script.
The thing is, MD5 isn't strictly encryption, it's a 32bit hashing algorythm, meaning that whatever you use md5() on turns into a unique 32 character alpha numeric string (no two different inputs should generate the same MD5 hash).
The only way to have account recovery without going to some lengths to crack MD5 (in order to do this, you'd need to have an app which could grab the hashed password from the DB and run it against a dictionary of words, but the chances of this working if the user has a decent password are pretty much nothing).
Your best bet would be to generate a new password and send the user that before hashing it and inserting it into the database, overwriting the old password.
Second question:
I don't know much about using PHP's mail functionality as I haven't done anything much with it, but I'm pretty sure google will have links to tutorials on PHP mail functions as PHP is well documented.
Current project: CMS Object.
Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
Release date: NEVER!!!
so it will b easy for me if u ppl refer me any code or tutorials
Assuming your new password will be flower:
[php]
$pass = md5("flower");
$insert = mysql_query("UPDATE yourusertable SET password='".$pass."' WHERE username = 'theaccountyouarechanging'") or die("DIED!!");
[/php]
Then you just send the user the password, which is flower
I'm assuming you're already connected to the database... If not, I can help you with that, or you could look through DD's tutorial listing.
Current project: CMS Object.
Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
Release date: NEVER!!!
he should click on the like ex. www.ursite.com/activate.php?act=532rwerr55
and then your activation script will check in the database[PHP]
mysql_query("SELECT * FROM users WHERE actkey = '$act'[/PHP]
assuming that you turned the activation key into a variable, [PHP]$act = $_GET;[/PHP]
PHP Mail Function:
once the user registers, turn the email value into a variable
[PHP]$email = $_POST;[/PHP]
then use phps mail() function as such:
[PHP]mail(STRING TO, "STRING SUBJECT", "STRING MESSAGE"[/PHP]
maybe this can do a better job of explaining:
http://us2.php.net/function.mail
so...
[PHP]
mail($email, $subject, $message[/PHP]
assuming you put all your information into variables
and that should work
maybe someone else can explain better