誰かが私の連絡先フォーム (HTML & PHP) を手伝ってくれることを願っています。受信したメールに「会社名」の欄がありません。他のすべてのフィールドは正常に機能します。
ここに私のHTMLフォームコードがあります:
<form action="contact.php" method="post">
Company Name<br>
<input type="text" name="cf_company" size="60">
<span class="contact"><img src="images/AIS Logo New.png" alt="AIS logo" width="325" height="170" hspace="25" align="right" class="contactimage"></span><br><br>
Contact Name<br>
<input type="text" name="cf_name" size="60">
<br><br>
Email<br>
<input type="text" name="cf_email" size="60">
<br><br>
Phone Number<br>
<input type="text" name="cf_phone" size="60">
<br><br>
State<br>
<input type="text" name="cf_state" size="60">
<br><br>
Sic Code<br>
<input type="text" name="cf_sic" size="60">
<br><br>
Total # of Employees<br>
<input type="text" name="cf_employees" size="60">
<span class="contact"><img src="images/People_image.jpg" alt="AIS logo" width="274" height="177" hspace="25" align="right" class="contactimage"></span><br><br>
Current Carrier<br>
<input type="text" name="cf_carrier" size="60">
<br><br>
Present Experience Mod<br>
<input type="text" name="cf_experience" size="60"><br><br>
Are you presently in the Assigned Risk Pool?<br>
<input name="cf_pool" type="text" size="60">
<br><br>
Comments/Additional Information<br>
<textarea name="cf_message" cols="75" rows="8"></textarea><br><br><br>
<center><input type="submit" value="Send">
<input type="reset" value="Clear">
そして、ここに私のPHPコードがあります:
<?php
$field_company = $_POST['cf_company'];
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_phone = $_POST['cf_phone'];
$field_state = $_POST['cf_state'];
$field_sic = $_POST['cf_sic'];
$field_employees = $_POST['cf_employees'];
$field_carrier = $_POST['cf_carrier'];
$field_experience = $_POST['cf_experience'];
$field_pool = $_POST['cf_pool'];
$field_message = $_POST['cf_message'];
$mail_to = 'xxxxxxx@aol.com';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_company."\n";
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'State: '.$field_state."\n";
$body_message .= 'Sic: '.$field_sic."\n";
$body_message .= 'Employees: '.$field_employees."\n";
$body_message .= 'Carrier: '.$field_carrier."\n";
$body_message .= 'Experience: '.$field_experience."\n";
$body_message .= 'Pool: '.$field_pool."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to xxxxxxxxx@aol.com');
window.location = 'contact.html';
</script>
<?php
}
?>
* *私が受け取った電子メールのフィードバックは次のとおりです (会社名の情報を除いたもの)。
送信者: Kimberly 電子メール: xxxxxx@aol.com 電話: 909-xxx-xxxx 州: CA Sic: 45677 従業員: 35 キャリア: なし 経験: なし プール: いいえ メッセージ: TEST