2
我開發了一個php電子郵件激活碼,用於在註冊後激活用戶的帳戶,我想要的是如果用戶第一次單擊激活鏈接後,鏈接將被禁用,任何人都可以提供幫助,非常感謝! 這裏是我的PHP代碼:如何在第一次點擊後禁用電子郵件鏈接
$to = $email;
$subject = " Your Registration";
$message = "Welcome to our website!\r\rThanks for completing registration at www.example.com.
You can complete registration by clicking the following link:\rhttp://www.example.com/verify.php?$activationKey\r\rIf this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ www.example.com Team";
$headers = 'From: [email protected] example.com' . "\r\n" .
'Reply-To: [email protected] example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
您需要一個唯一的,可識別的字段值('key','activateid'等)來驗證請求,然後您需要存儲一個值,該值顯示帳戶已激活,然後在激活中進行檢查.php代碼來確保它尚未被使用。 –