Jump to content

md5 password


unistake

Recommended Posts

Hi all,

 

I am trying to make a 'forgot password' script.

 

The passwords in the database are md5 encrypted.

 

Is there a way to reverse this md5 password and send the forgotten password in its orginal for to the user through email?

 

Thanks.

 

<?PHP 
include("cxn.php");

$sql = "SELECT password FROM Members WHERE email='$_POST[email]'";
$result = mysqli_query($cxn,$sql)
or die ("Couldn't execute query");

$num = mysqli_num_rows($result);

if ($num >0) // Email Address Found 
{
	$password = md5($_POST['password']); // Trying to take the md5 off the password here.

	$to = "$_POST[email]";
	$subj = "Password for website.co.uk";
	$mess = "Your password for www.website.co.uk is: \n
			$_POST['password'] \n
			Please login with your email address and this password. Thank you.";
	$mailsend = mail($to,$subj,$mess,$headers);

	$update= "An email containing your password has been sent to". $_POST['email'].".";
	include("signin-redirect.php");
}
else // Email Address Not Found
{
	$registrationerror = "The email address '$_POST[email]' is already registered!";
	include("signin-redirect.php");
}

?>

Link to comment
https://forums.phpfreaks.com/topic/216250-md5-password/
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.