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: hello@entangledencounters.com' . "\r\n" .
'Reply-To: hello@entangledencounters.com' . "\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
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..

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.