reseturl для использования только активного сеанса?
Код: Выделить всё
public function sendToken($email, $resetUrl) {
// Validate email address
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
return false; // Invalid email address
}
// Output or log the value of the reset URL
echo "Reset URL: $resetUrl"; // Output to screen
// Encode HTML content
$emailBody = '
To reset your password, click here.';
// Set additional headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: Your Name \r\n";
$headers .= "Reply-To: Your Name \r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
// Send email
$subject = 'Reset your password';
if (mail($email, $subject, $emailBody, $headers)) {
return true; // Email sent successfully
}
return false; // Failed to send email
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... me-session