這裏是我的代碼:提交PHP電子郵件表單後,如何重定向到HTML頁面?
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$formcontent = "From: $name \n Email: $email \n Subject: $subject \n Message: $message";
$recipient = "[email protected]";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
?>
我只需要知道如何點擊提交,並確保通過腳本發送電子郵件後重定向到一個HTML頁面。任何幫助將不勝感激!
我試過一樣,它說警告:不能修改標題信息 - 標題已發送 –
請參閱https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in -php – Barmar