Hi there,
I am a newbee to php and working on a site…had this code of contact form and its not working… Can any one help?? its urgent :-[
[php]<?php
$field_name = $_POST[‘cf_name’];
$field_email = $_POST[‘cf_email’];
$field_phonenumber = $_POST[‘cf_phone’];
$field_message = $_POST[‘cf_message’];
$mail_to = ‘yash,[email protected]’;
$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_phonenumber."\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('Message failed. Please, send an email to [email protected]');
window.location = 'contact.html';
</script>
<?php
}
?>[/php]