Created
March 19, 2013 22:21
-
-
Save anonymous/5200669 to your computer and use it in GitHub Desktop.
These are the only codes i am using to create the contact form at the minute.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$field_name = $_POST['cf_name']; | |
$field_email = $_POST['cf_email']; | |
$field_message = $_POST['cf_message']; | |
$mail_to = 'mail@markblackler.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. I will contact you as soon as possible.'); | |
document.location = 'http://www.markblackler.com' | |
</script> | |
<?php | |
} | |
else { ?> | |
<script language="javascript" type="text/javascript"> | |
alert('Message failed. Please, send an email to mail@markblackler.com'); | |
document.location = 'http://www.markblackler.com' | |
</script> | |
<?php | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fifth"> | |
<div class="scrollblock3"> | |
<div class="contact-left"> | |
<form action="contact.php" method="post"> | |
<font style="background-color: black;">Your name: </font><br> | |
<input type="text" name="cf_name"><br> | |
<font style="background-color: black;">Your e-mail: </font><br> | |
<input type="text" name="cf_email"><br> | |
<font style="background-color: black;">Message: </font><br> | |
<textarea name="cf_message" rows="12" cols="60"></textarea><br><br> | |
<input type="submit" value="Send"> | |
<input type="reset" value="Clear"> | |
</form> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment