可能重复:
PHP 已发送的标头
if($sendmail) {
echo "<div class=\"success\" class=\"regdet\">Congratulations $name! You have successfully registered for <span>AADAB 2013</span>! An email has been sent to your email with the details of your form.<br><br>If the page does not automatically redirect you in 5 seconds, click <input type=\"button\" value=\"Here\" onclick=\"window.close()\"> to continue.</div>";
header (refresh: 5, url="form.php");
} else {
echo "<span style=\"color: red; background: rgba(219,219,219,0.7);\">There was an error in submitting your form. Click <a href=\"form.php\">here</a> to try again!</span>";
}
我试图在 5 秒后将用户重定向到表单(这是同时具有表单和 PHP 命令的当前表单)......因为它没有发生,我试图包含一个按钮来关闭在表单确认页面上按下后的窗口。
这也没有发生。
正在显示消息,并且表单正在完美地将电子邮件发送到我的电子邮件帐户,但这一小部分让我很烦!