I developed a php email activation code for activate user’s account after registration, what I want is that if the user click the activation link again after first time, the link will be disabled, any one could help, thanks a lot!
here is my php code:
$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: noreply@ example.com' . "\r\n" .
'Reply-To: noreply@ example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
You need to save
activation codeinto the database and whenever he/she request for the activation, compare the requested activation code against the database and if it is valid then you have toremovethatactivation codefrom the database just after you setconfirmparameter for that account.