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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.