知道如何在 PHP 电子邮件响应程序中显示复选框标签而不是值吗?我的电子邮件回复程序仅显示复选框值而不是标签。我需要为每个标签实现文档翻译数组。
PHP代码
<?php
if(isset($_POST) && ($_POST['send'] == 1)){
$documents = array(
'document1' => 'http://www.example.com/document1.doc',
'document2' => 'http://www.example.com/document2.doc',
'document3' => 'http://www.example.com/document3.doc'
'document4' => 'http://www.example.com/document4.doc'
);
$to = 'lubosmasura@gmail.com';
$subject = 'Prihláška na školenie';
$name = $_POST['name'];
$email = $_POST['email'];
$document = implode(", ",$POST['document']);
if(isset($_POST['document']) && count($_POST['document']) > 0){
foreach($_POST['document'] as $doc){
if(isset($documents[$doc])){
$message = "
ŠKOLENIE: $document
";
}
}
}
$headers = 'From: noreply@marcelaskolenia.sk' . "\r\n" .
'Reply-To: noreply@marcelaskolenia.sk' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
}
?>
HTML代码
<form method="post" action="test.php">
<p class="center">Vyberte školenie</p>
<label class="container riadok"><p for="document1" class="dolava">§20 Poučená osoba</p>
<input type="checkbox" name="document[]" value="document1" id="document1">
<span class="checkmark"></span>
</label>
<label class="container riadok"><p for="document" class="dolava">Aktualizácia: §21 AŽ §24</p>
<input type="checkbox" name="document[]" value="document2" id="document2">
<span class="checkmark"></span>
</label>
电子邮件回复器可以工作,但不显示选定的复选框标签,而仅显示 HTML ŠKOLENIE 中的值:CHECKBOX LABEL HERE
有任何想法吗?谢谢
侃侃无极
忽然笑