在下面的php脚本中,Dreamweaver每次添加重定向标头时都会给出语法错误:
header('Location: thankyou.htm');
信息发送到我的电子邮件地址没有问题,但客户端没有重定向到thankyou.htm页面。无论我是否输入完整的网址。真诚地感谢任何帮助。请保持解释简单 - 谢谢!!
请看下面......
<?php
$senderName = $_POST['name'];
$senderEmail = $_POST['email'];
$sendToEmail = "wildlifeart@heathersoos.ca";
$emailMessage = $_POST['message'];
$recipient = "$sendToEmail";
$headers = "From: $senderEmail ";
$message = "From: $senderName, \nEmail Address: $senderEmail\nMessage: $emailMessage";
$message = StripSlashes($message);
mail($recipient, "Heather's Artwork", $message, $headers)
header('Location: thankyou.htm');
?>
答案 0 :(得分:4)
您在
缺少分号(;
)
mail($recipient, "Heather's Artwork", $message, $headers); <-- here