コードを修正しようとしています。3 行目、5 行目、9 行目にエラーがあります。困惑しています。それはかなり良いようですが、そうではありません:/
<?php
if($_POST['submit']) {
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST[$_POST['comments'])) {
$error = true;
}else{
$to = "theloregame@gmail.com"
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$comments = trim($_POST['comments']);
$subject = "Contact Form";
$messages = "name: $name \r\n Email: $email \r\n Comments: $comments";
$headers = "From:" . $name;
$mailesent = mail($to, $subject, $messages, $headers);
if($mailsclient) {
$sent = true;
}
}
}
?>