Jump to content

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

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.