Renaming and fixing some filestructure

This commit is contained in:
Kasper Rynning-Tønnesen
2016-12-12 16:07:06 +01:00
parent d35a6599c2
commit c5d9b2f0d1
99 changed files with 386 additions and 438 deletions

22
public/php/mail.php Executable file
View File

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