Jump to content

SMTP for Entangled Encounters


yoddabyte

Recommended Posts

I'm looking to send the reset password information back to users, but for some reason it's not working.  Am I missing something?

 

/*RESET*/
if($hidden == "reset+63-"){
$MemberCheck = mysql_query("SELECT * FROM members WHERE email = '$email'");
if(mysql_num_rows($MemberCheck)==1)
{
$thisView = mysql_fetch_array($MemberCheck);
$MemberCode = $thisView['code'];
$code = md5(uniqid(rand()));
$updateMember = mysql_query("UPDATE members SET pass = 'reset' WHERE email = '$email'");
$insertReset = mysql_query("INSERT INTO members_reset(`idMember`,`code`)VALUES('$MemberCode', '$code')");
$to = "$email";
$subject = "Password Reset";
$message = "Click or Copy the link below to reset your Password:<br/>http://entangledencounters.com/confirmation.php?reset=$code\r\n";
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
 
if(mail($to, $subject, $message, $headers))
{
echo '<script>';echo 'location.href="http://entangledencounters.com/splash.php?error=3&request=3";';echo '</script>';
}else{echo '<script>';echo 'location.href="http://entangledencounters.com/splash.php?error=4&request=2";';echo '</script>';}
}else{echo '<script>';echo 'location.href="http://entangledencounters.com/splash.php?error=4&request=2";';echo '</script>';}
}
/*RESET*/
Link to comment
https://forums.phpfreaks.com/topic/297251-smtp-for-entangled-encounters/
Share on other sites

You need to check the $_GET['reset'] value against the saved random code you have in database.

A form so they can input the new password.

Proper checks on users email and the user, data from the form updates password.

 

You need some better logic in this, more if/else statements and less queries depending the immediate action are doing..

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.