在php中,我从表单中收集信息并构建电子邮件。然后,我将以下代码在200响应代码后将用户重定向到页面。
// Send the email.
if (mail($recipient, $subject, $email_content, $email_headers)) {
// Set a 200 (okay) response code.
header('Location: https://my.website.com/wp-content/uploads/2015/07/a.pdf');
exit;
} else {
// Set a 500 (internal server error) response code.
header("HTTP/1.1 500 Internal Sever Error");
echo "Oops! Something went wrong and we couldn't send your message.";
}
不幸的是,当我尝试对表单进行汇总时,Chrome会冻结,我必须关闭该标签。有关此问题的原因和解决方法的任何解释?