I found a form that I would like to use. But all so like to add more fields. As it is now. When I click on send. it doesn't work. Can someone help me please.
This is what I have now.
[z{link to commercial site redacted - see faq}]
Sorry, my mistake.
This is the .php file. The submit button doesn't work.
here is the form HTML
This is what I have now.
[z{link to commercial site redacted - see faq}]
Sorry, my mistake.
This is the .php file. The submit button doesn't work.
Code:
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$mail_to = 'dedalusonline@yahoo.com';
$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 shortly.');
window.location = 'contact_page.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to louis@charismacommunications.ca');
window.location = 'contact_page.html';
</script>
<?php
}
?>
Code:
<form action="contact.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your e-mail<br>
<input type="text" name="cf_email"><br>
Message<br>
<textarea name="cf_message"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
Comment