0
我创建了一个邮件表单。 PHP页面读取输入,将其发送到邮件,然后重定向到某个页面。挺直的,之前做过。邮件得到发送,但您不会被重定向。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 = "[email protected]";
$subject = "Bericht van $name";
$headers = "From: $email \r\n";
mail($to,$subject,$message,$headers);
header('Location: http://www.newlocation.nl/');
?>
我在做什么错?
为我工作.. – 2013-02-12 21:03:51
type exit;在header()之后; – 2013-02-12 21:04:02
你可能在'<?php'之前或'?>'之后有一些空白或者正在发出某种类型的通知 – 2013-02-12 21:04:07