我正在使用 PHP,我收到了这条消息
无法修改标头信息 - 标头已由(输出开始于
执行如下代码后:
<?php
if (condition) {
if (condition) {
//Statement
}
$to = $_POST['email'];
$subject = "Registration Confirmation";
$message = '
<html>
<head>
<title>'.$subject.'</title>
</head>
</html>
';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <contact@ghanalifestore.com>' . "\r\n";
mail($to,$subject,$message,$headers);
header('Location: reset.php?username='.$username);
exit();
}else {
//statement
}
Run Code Online (Sandbox Code Playgroud)
根据Stackoverflow 的这个答案,我认为错误来自变量中的 HTML 代码$message。我真的不知道如何修改该变量的内容以避免错误。
请帮我解决这个问题。
| 归档时间: |
|
| 查看次数: |
36981 次 |
| 最近记录: |