Hi,
I am new to php, i have create contact us form in html and process the data with php. mail is sucessfully send every time to my desired email id. but the data is missing. i.e i am not getting the data feeded in contact us form in my mail.
will you please help me out.
please find the php script for the ref.
<?php
$field_name = $_POST['name'];
$field_company = $_POST['company'];
$field_phone = $_POST['phone'];
$field_email = $_POST['email'];
$field_message = $_POST['message'];
$mail_to = 'mymail@abc.com';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$email."\r\n";
$headers .= 'Reply-To: '.$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 mymail@abc.com');
window.location = 'contact.html';
</script>
<?php
}
?>
Thanks
Mandeep Randhawa

