我正在尝试制作电子邮件表格,并且我一直在寻找一种很好的方法来做到这一点。问题是当我单击发送时,我收到此“解析错误:语法错误,第 12 行上的意外'<<'(T_SL)”。有人可以看到问题所在吗?
<?php
$to = '.........@gmail.com';
$subject='hi there you';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$message = <<<< EMAIL
Hi! My name is $name.
$message
From $name
my email is $email
EMAIL;
$header ='$email';
if($_POST){
mail($to, $subjects, $message, $header);
$feedback = 'Thankyou for your email';
echo $feedback;} ?>
html
<form action="process.php" method="post">
<ul>
<li>
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
</li>
<li>
<label for="email">Email:</label>
<input type="text" name="email" id="email" />
</li>
<li>
<label for="topic">Topic:</label>
<select>
<option value="optiona">optiona</option>
<option value="optionb">optionb</option>
<option value="optionc">optionc</option>
</select>
</li>
<li>
<label for="message">your message:</label>
<textarea id="message" name="message" cols="42" rows="9"></textarea>
</li>
<li><input type="submit" value="Submit"></li>
</form>