开发者

how to disable the email message link after first click

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 = 'Fro开发者_JAVA百科m: 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 code into 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 to remove that activation code from the database just after you set confirm parameter for that account.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜