this is my contact form.html
this is my mail.php
is ther anything wrong? plz help
Code:
<form id="contacts-form" method="post" action="mail.php" onSubmit="return validateForm(this)">
<fieldset>
<div class="field"><label>Full Name:</label><input type="text" value="" name="name"/> <font color="#FF0000" size="+1">*</font></div>
<div class="field"><label>E-mail:</label><input type="text" value="" name="email"/> <font color="#FF0000" size="+1">*</font></div>
<div class="field"><label>Phone:</label><input type="text" value="" name="phone"/> <font color="#FF0000" size="+1"></font></div>
<div class="field"><label>Subject:</label><input type="text" value="" name="subject"/></font></div>
<div class="field"><label>Services:</label><select name="services">
<option>------------Select------------</option>
<option>Call Center Services</option>
<option>Data Entry Services</option>
<option>KPO Services</option>
<option>Health Care Services</option>
<option>Software Development</option>
</select>
<font color="#FF0000" size="+1">*</font>
</div>
<div class="field"><label>Message:</label><textarea name="message" cols="" rows=""></textarea> </div>
<div align="center"><input type="submit" value="SUBMIT"/></font></div>
<!--<div class="alignright"><a href="mail.php" class="button" onclick="document.getElementById('contacts-form').submit()"><em><b>Submit</b></em></a>
</div>-->
</fieldset>
</form>
this is my mail.php
Code:
<?php
//if(isset($_POST['email'])) {
$email_to = "lark.imp@gmail.com "; //mail id
$email_subject = "Outsource Projects to India";
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$services = $_POST['services'];
$message = $_POST['message'];
$error_message = "";
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
//}
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Phone: ".clean_string($phone)."\n";
$email_message .= "Services: ".clean_string($services)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.$email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<?php
}
?>
Comment