You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
938 B
PHP
25 lines
938 B
PHP
<?php
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
|
|
header('Access-Control-Allow-Headers: token, Content-Type');
|
|
header('Access-Control-Max-Age: 1728000');
|
|
header('Content-Length: 0');
|
|
header('Content-Type: text/plain');
|
|
die();
|
|
}
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Content-Type: application/json');
|
|
|
|
$postData = file_get_contents('php://input');
|
|
$data = json_decode($postData, true);
|
|
|
|
if($data) {
|
|
$message = "Фио: ". $data['fio'] ."\r\nE-mail: ". $data['email'] ."\r\nНомер телефона: ". $data['phone'] ."\r\nОбращение: ". $data['message'] ."\r\n";
|
|
|
|
mail('talentcompany@yandex.ru', 'Заявка', $message);
|
|
|
|
echo json_encode('{"status": "true"}');
|
|
}
|
|
?>
|