-1
Problem: email sent to reset password, arrives with NOT CLICKABLE link. I believe there is something wrong in the URL variable.
<?php
if (isset($_POST['reset-request-submit'])) {
$selector = bin2hex(random_bytes(8));
$token = random_bytes(32);
$url = "www.wonline.com.br/create-new-password.php?selector=" . $selector . "&validator=" . bin2hex($token);
$expires = date("U") + 1800;
$to = $userEmail;
$subject = 'Redefina a sua senha';
$message = '<p>Nós recebemos sua solicitação de Reconfigurar a senha. Use o link de reconfiguraçao abaixo. ';
$message .= 'Se não foi você quem solicitou, ignore este email</p>';
$message .= '<p>Aqui está o seu link de redefiniçao de senha:</p></br>';
$message .= '<a href="' . $url . '">' . $url . '</a>';
$headers = "From: <[email protected]>\r\n";
$headers .= "Reply-To: [email protected]\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);
header("Location: ../reset-password.php?reset=success");
} else {
header("Location: ../signup.php");
exit();
}
?>
PERFECT! Solved the question! That’s all it was! I tested it on my yahoo email. I’m going to test it now on gmail and others. Thanks a lot!
– Eugenio de Castro
It worked with Gmail too! Great! That’s right! Thanks! I forgot to mention that I used option 1 that was given: $url = putting http in front.
– Eugenio de Castro