Thank you very much, it helped, but partially, or I am still doing something wrong.
This is the code right now
PHP Code:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_postalcode = $_POST['cf_postalcode'];
$field_telephone = $_POST['cf_telephone'];
$field_service = $_POST['cf_service'];
$field_frequency = $_POST['cf_frequency'];
$field_message = $_POST['cf_message'];
$mail_to = 'info@cleaningcrazy.com';
$subject = 'Customer '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Postal Code: '.$field_postalcode."\n";
$body_message .= 'Telephone: '.$field_telephone."\n";
$body_message .= 'Service Type: '.$field_service."\n";
$body_message .= 'Frequency: '.$field_frequency."\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 = 'contactus.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to info@cleaningcrazy.com');
window.location = 'contactus.html';
</script>
<?php
}
?>
Quote:
And this is the Email I receive:
From: Seb
E-mail: szpadlolaizer@gmail.com
Postal Code:
Telephone:
Service: General Cleaning
Frequency:
Message: hi
|
As you can see I am missing values for Postal Code, Telephone and Frequency.
To make it easier, this is form on the website:
HTML Code:
<h3>Contact Form</h3>
<form action="contact.php" method="post" enctype="multipart/form-data" id="ContactForm">
<div>
<label>
Enter your name<br />
<input class="imInput imInput_1" type="text" name="cf_name" id="Itm_8_00_3" onkeypress="return imKeyFilter(0,event);" />
</label>
<label>
Enter your e-mail<br />
<input type="text" name="cf_email" value="" />
</label>
<label>
Enter your postal code<br />
<input type="text" name="cf_message" value="" />
</label>
Enter your telephone number<br />
<input type="text" name="cf_message" value="" />
</label>
Service Type<br />
<select class="imInput imInput_1" name="cf_service" id="Itm_8_00_5">
<option selected="selected">-</option>
<option>General Cleaning </option>
<option>Commercial Cleaning</option>
<option>Move in/out Cleaning</option>
</select>
Cleaning Frequency:<br />
<select class="imInput imInput_1" name="cf_message" id="Itm_8_00_6">
<option selected="selected">-</option>
<option>Daily</option>
<option>Weekly</option>
<option>Bi-weekly</option>
<option>Monthly</option>
<option>One-time</option>
</select>
</label>
<br />
Enter your message<br />
<textarea cols="10" rows="3" name="cf_message"></textarea>
</div>
<div class="container">
<a href="#" class="right" onclick="document.getElementById('ContactForm').submit()">Send</a>
<a href="info@cleaningcrazy.com" class="right" onclick="document.getElementById('ContactForm').reset()">Clear</a>
<p/>
</div>
</form>