duanne9313 2016-08-26 17:47
浏览 24

在PHP中发送包含链接的电子邮件,然后触发POST请求? [重复]

This question already has an answer here:

So i have some code that is sending an email to a user. The email contains a link which allows the user to change their password if they have forgotten it. The code works fine and sends the email. When i click the link it sends a GET request that contains the email of the user in the URL. Im just curious, is there a way to alter the code in php so when it sends the email the link in the email then sends a POST request. With the email of the user inside the POST body? Here is the code that is currently sending the email. Im not even sure if what im asking is possible.

$link = "http://localhost/myphp/talkbook2/forgotpassword/ResetPassword.php?Email=".$email;
$title = "Please click this link to reset your password";
$subject = "Reset Password";
$message = "<a href='". $link. "'>".$title. "</a>

";
$headers  = "MIME-Version: 1.0". "
";
$headers .= "Content-type: text/html; charset=iso-8859-1". "
";
$headers .= "From: TalkBook". "
";
$headers .= "Reply-To: talkbookapp@gmail.com". "
";
$headers .= "Return-Path: talkbookapp@gmail.com". " 
";

if(!isset($_SESSION['passwordEmailSent']) && empty($_SESSION['passwordEmailSent']))
{
    $send = mail($email, $subject, $message, $headers);
    $_SESSION['passwordEmailSent'] = 1;
}
else
{
    $send = false;
}

return $send;
</div>
  • 写回答

1条回答 默认 最新

  • doujiao8491 2016-08-26 17:52
    关注

    Just create a html form in email and action="http://yourdomain.com/post.php" and method="post" also you can use input type=hidden for saving that field. or use some field and set visibility to hidden. and populate those fields with values.

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改