dongliyun3301 2011-09-21 01:07
浏览 49
已采纳

如何在第一次单击后禁用电子邮件链接

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!Thanks for completing registration at www.example.com.
   You can complete registration by clicking the following    link:http://www.example.com/verify.php?$activationKeyIf this is an error, ignore this    email and you will be removed from our mailing list.Regards,\ www.example.com Team";
    $headers = 'From: noreply@ example.com' . "
" .

'Reply-To: noreply@ example.com' . "
" .

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

mail($to, $subject, $message, $headers);
  • 写回答

1条回答 默认 最新

  • duanji5746 2011-09-21 01:12
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题