Ami*_*mit -1 html php email header
我相信你们都知道这个错误:
Warning: Cannot modify header information - headers already sent by (output started at /homepages/4/d374499247/htdocs/wp-content/themes/tyler/mail.php:1) in /homepages/4/d374499247/htdocs/wp-content/themes/tyler/mail.php on line 34
这是代码:
if (strpos($email,'@') !== false) {
ob_start();
mail($to,$subject,$message,$headers);
header("Location: thankyou.html");
ob_end_flush(); }
Run Code Online (Sandbox Code Playgroud)
谁能在这里提供任何帮助?我只想要邮件()信息,然后转到位置页面
编辑:这是整个代码..
<?php
$to = 'myemail@gmail.com';
$subject = '???? ??????? ?????? ?????';
$message =
'???? ??????? ?????? ?????' . "\n\n" .
'??: ' . $_REQUEST['name'] . "\n\n" .
'???? ????????: ' . $_REQUEST['email'];
$email = $_REQUEST['email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/plain; charset=ISO-8859-1";
// server-validation
if (strpos($email,'@') !== false){
mail($to,$subject,$message,$headers);
header("Location: thankyou.html");
} else {
echo "<p class='error'>????? ????'? ?????.</p>";
}
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1248 次 |
| 最近记录: |