// from the form
$name = trim(strip_tags($_POST['name']));
$email = trim(strip_tags($_POST['email']));
$message = htmlentities($_POST['message']);
// set here
$subject = "Contact form submitted!";
$to = 'your@email.com';
$body = HTML
$message
HTML;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
// send the email
mail($to, $subject, $body, $headers);
// redirect afterwords, if needed
header('Location: thanks.html');
問題は、天気かどうかということです。htmlメール本文内にphp ifステートメントを挿入するか、そこに追加するのに最適な方法です。詳細なインベントリを作成しています。送信したら、メールで送信する必要があります。しかし、完全なインベントリ(空の入力を含む)を電子メールで送信したくありません。0以外のフィールドのみを電子メールで送信する必要があります。私は考えていました。
if($ armChair> 0){echo'アームチェア:'。$ _POST ['armChair']; }]
しかし、それは実際には機能していないようです...何かアイデアはありますか?