我在电子邮件中发送重置密码后如何获取链接中的文本 - php

时间:2017-09-12 19:26:18

标签: php

我要做的是在发送电子邮件后输入我输入的链接中的文本。这样的事情。

$ForgotID = 'DN6ZPzA6247yWhHaFbXi';

$messageBody = '<a href="https://******.com/ResetPasswordForm.php?id='.$ForgotID.'">Click here to change your password.</a>';

然后当用户点击链接时,它会重定向到给定的链接,然后我如何获得id='_____________________'?所以,这是我在更新密码之前搜索数据库中特定行的方法。我怎么做的?谢谢你们。

1 个答案:

答案 0 :(得分:1)

电子邮件消息:

<?php

$ForgotID = 'DN6ZPzA6247yWhHaFbXi';

$messageBody = '<a href="https://******.com/ResetPasswordForm.php?id='.$ForgotID.'">Click here to change your password.</a>';

?>

ResetPasswordForm.php (在ResetPasswordForm.php上)

//On Click On Mail Verification Link 
//Browser Url:  https://******.com/ResetPasswordForm.php?id=DN6ZPzA6247yWhHaFbXi

<?php 

$id = $_GET['id'];

//Now After Get This $id Here, Check In Your Table in Verification_code Column , 
//Where its found ! and if Found Then Take Email Id And Change the Password and Update it,
//And if Not Found Then Display the message token mismatch. 

?>