【发布时间】:2012-12-19 09:11:13
【问题描述】:
所以dreamweaver 告诉我我在第5、8、10 和12 行有语法错误。但我不明白为什么?
<?php
if(isset($_POST['submit'])) (
$msg = 'Name: ' .$_POST['FirstName'] .$_POST['LastName'] ."\n"
.'Email: ' .$_POST['Email'] ."\n"
.'Message: ' .$_POST['Message'];
mail('email@me.com', 'Message from website', $msg);
header('location: contact-thank-you.php');
)
else (
header('location: contact.php');
exit(0);
)
)
?>
【问题讨论】:
-
运行代码,看看 PHP 有没有报错。
-
您使用的是
(和),而不是花括号。