Php 如何在首次单击后禁用电子邮件链接

Php 如何在首次单击后禁用电子邮件链接,php,Php,我为注册后激活用户帐户开发了一个php电子邮件激活代码,我想要的是,如果用户在第一次点击激活链接后再次点击,该链接将被禁用,任何人都可以帮助,谢谢! 以下是我的php代码: $to = $email; $subject = " Your Registration"; $message = "Welcome to our website!\r\rThanks for completing registration at www.example.com. You can com

我为注册后激活用户帐户开发了一个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: noreply@ example.com' . "\r\n" .

'Reply-To: noreply@ example.com' . "\r\n" .

'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

您需要将激活码保存到数据库中,无论何时他/她请求激活,将请求的激活码与数据库进行比较,如果该激活码有效,则必须在为该帐户设置
确认
参数后,从数据库中删除
激活码

您需要一个唯一的、可识别的字段值(
key
activateid
,等等)来验证请求,然后需要存储一个值来证明帐户已被激活,然后在activate.php代码中进行检查以确保它尚未被使用。谢谢,我的意思是,有没有一种方法可以阻止链接功能,这样当我点击eamil链接时,它就不会工作了。