Emi*_*lly -7 php syntax sendmail
所以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);
)
)
?>
Run Code Online (Sandbox Code Playgroud)
使用:
if () {
....
} else {
....
}
other than
if () (
....
) else (
....
)
Run Code Online (Sandbox Code Playgroud)