kevin_yao7714
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 1
Hello. I am having some trouble working my contact form in my site.
I am not sure if it's my php script or if something is wrong with the server as I heard there were new upgrades of some kind. I appreciate any help with this.
Here is the page: www.kyleman.x10.bz/contact.htm
And here is the php code:
<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_message = $_POST['message'];
$mail_to = 'info@kyleman.x10.bz';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\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 soon.');
window.location = 'contact.htm';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please try again, or send an email to info@kyleman.x10.bz');
window.location = 'contact.htm';
</script>
<?php
}
?>
Did I miss something? Thanks!
I am not sure if it's my php script or if something is wrong with the server as I heard there were new upgrades of some kind. I appreciate any help with this.
Here is the page: www.kyleman.x10.bz/contact.htm
And here is the php code:
<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_message = $_POST['message'];
$mail_to = 'info@kyleman.x10.bz';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\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 soon.');
window.location = 'contact.htm';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please try again, or send an email to info@kyleman.x10.bz');
window.location = 'contact.htm';
</script>
<?php
}
?>
Did I miss something? Thanks!