Hi,
I am trying to create a form that has, Name, Phone, Email, address and when such as month.
Currently the name, email is working but the rest are not. Can someone assist please
PHP code:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'test@eircom.net';
$subject = ' booking form '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Address: '.$field_address."\n";
$body_message .= 'when: '.$field_message."\n";
$headers = 'From: '.$cf_email."\r\n";
$headers .= 'Reply-To: '.$cf_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you. We will contact you shortly.');
window.location = ' thankyou.html ';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to
test@eircom.net');
window.location = 'thankyou.html';
</script>
<?php
}
?>
Html code:
<form action="popup.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your number<br>
<input type="phone" name="cf_phone"><br>
Your e-mail <br>
<input type="text" name="cf_email"><br>
Address <br>
<input type="text" name="cf_address"><br>
When last cleaned <br>
<input type="text" name="cf_when"><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
I am trying to create a form that has, Name, Phone, Email, address and when such as month.
Currently the name, email is working but the rest are not. Can someone assist please
PHP code:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'test@eircom.net';
$subject = ' booking form '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Address: '.$field_address."\n";
$body_message .= 'when: '.$field_message."\n";
$headers = 'From: '.$cf_email."\r\n";
$headers .= 'Reply-To: '.$cf_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you. We will contact you shortly.');
window.location = ' thankyou.html ';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to
test@eircom.net');
window.location = 'thankyou.html';
</script>
<?php
}
?>
Html code:
<form action="popup.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your number<br>
<input type="phone" name="cf_phone"><br>
Your e-mail <br>
<input type="text" name="cf_email"><br>
Address <br>
<input type="text" name="cf_address"><br>
When last cleaned <br>
<input type="text" name="cf_when"><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>