Added contact-form

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-08 12:41:06 +01:00
parent 11ac0d75b2
commit f9f07e2d6d
10 changed files with 185 additions and 52 deletions

18
php/mail.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
if(isset($_POST['from']) && isset($_POST['message'])){
$from = htmlspecialchars($_POST['from']);
$message = htmlspecialchars($_POST['message']);
$headers = "From: " . $from . "\r\n";
$result = mail("contact@zoff.no", "Contact from form", $message, $headers);
if($result == FALSE){
echo "failure";
}else{
echo "success";
}
}
?>