Jump to content

password recovery


xcoderx

Recommended Posts

ok my register is like this $pass = md5($pass); how to not make it md5? could atleast someone help in this?

 

I'm starting to believe you're trolling this board...

 

Remove that line altogether, and md5 encryption will stop.

 

Edit: Actually, I'm now positive this is some seriously hardcore trolling. I'm about to potentially violate TOS Rule #14: Can someone lock this? Daniel0 perhaps?

Link to comment
https://forums.phpfreaks.com/topic/159233-password-recovery/#findComment-839798
Share on other sites

you leave registering how it is with the md5();

 

you make a separate file which changes the users password to something else, updates it in the database, and e-mails it to them.

$newpass = "hello";
mail(); // mail it to them
$newpass = md5($newpass);
mysql_query() // update pass in database to new one 

Link to comment
https://forums.phpfreaks.com/topic/159233-password-recovery/#findComment-839800
Share on other sites

If you wish to remove the MD5 (NOT recommened) then your need to remove it from ALL points where its used

ie Signup & Login

but your also need to reset ALL current passwords

 

MasterACE14 code

you leave registering how it is with the md5();

 

you make a separate file which changes the users password to something else, updates it in the database, and e-mails it to them.

$newpass = "hello";
mail(); // mail it to them
$newpass = md5($newpass);
mysql_query() // update pass in database to new one 

 

is valid and will work

 

here a slightly more complete code (untested)

<?php
$user = "Bob";
$newpass = "hello";

$Q = sprintf("SELECT ID,email FROM members WHERE name='%s' LIMIT 1", mysql_real_escape_string($user));
$result= mysql_query($Q) or die($Q.mysql_error());
$row = mysql_fetch_array($result);
mail($row['email'], 'password change', "Your new password ".$newpass); // mail it to them
$newpass = md5($newpass);
$Q = sprintf("UPDATE members SET password='%s' WHERE = id = %d",$newpass,$row['id']);
mysql_query($Q) or die($Q.mysql_error()); // update pass in database to new one 
?>

Link to comment
https://forums.phpfreaks.com/topic/159233-password-recovery/#findComment-839814
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.