mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
22 lines
466 B
PHP
Executable File
22 lines
466 B
PHP
Executable File
<?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";
|
|
}
|
|
}
|
|
|
|
?>
|