我创建了一个邮件表单。PHP 页面读取输入,将其发送到邮件,然后它应该重定向到某个页面。很直接,以前做过。邮件被发送,但您不会被重定向。
HTML 表单:
<form action="mailversturen.php" method="post">
<input type="text" name="naam" placeholder="Naam" class="inputtype" /><br />
<input type="text" name="email" placeholder="Email" class="inputtype" /><br />
<textarea name="bericht" placeholder="Bericht"></textarea>
<input type="reset" value="Reset" class="buttontype" />
<input type="submit" value="Verstuur" class="buttontype" />
</form>
PHP代码:
<?php
$name = $_POST['naam'];
$email = $_POST['email'];
$message = $_POST['bericht'];
$to = "name@domain.com";
$subject = "Bericht van $name";
$headers = "From: $email \r\n";
mail($to,$subject,$message,$headers);
header('Location: http://www.newlocation.nl/');
?>
我究竟做错了什么?