diff --git a/index.html b/index.html
index 9427e49..c58b429 100644
--- a/index.html
+++ b/index.html
@@ -820,27 +820,62 @@
diff --git a/send-form.php b/send-form.php
index 9c5ec55..cb988c3 100644
--- a/send-form.php
+++ b/send-form.php
@@ -1,32 +1,39 @@
"error", "message" => "Неверный запрос"]);
+ exit;
+}
- $message = "Имя: $name\n";
- $message .= "Телефон: $phone\n";
- $message .= "Email: $email\n";
- $message .= "Дата отправки: " . date('d.m.Y H:i') . "\n";
+$name = trim(strip_tags($_POST["name"] ?? ""));
+$phone = trim(strip_tags($_POST["phone"] ?? ""));
+$email = trim(strip_tags($_POST["email"] ?? ""));
- $headers = "From: no-reply@olimparena.aiconversion.ru\r\n";
- $headers .= "Reply-To: $email\r\n";
- $headers .= "Content-Type: text/plain; charset=utf-8\r\n";
+if (empty($name) || empty($phone)) {
+ echo json_encode(["status" => "error", "message" => "Имя и телефон обязательны"]);
+ exit;
+}
- if (mail($to, $subject, $message, $headers)) {
- // Можно перенаправить на успех
- header("Location: index.html#booking-success-modal");
- // или показать JSON для JS
- echo json_encode(["status" => "success"]);
- } else {
- echo json_encode(["status" => "error"]);
- }
+//$to = "receptionadmin@o-arena.ru"; // ← Измени на свой реальный email!
+$to = "rid89@mail.ru";
+
+$subject = "Новая заявка с сайта OlimpArena";
+
+$message = "📩 Новая заявка из всплывающего окна\n\n";
+$message .= "Имя: $name\n";
+$message .= "Телефон: $phone\n";
+$message .= "Email: $email\n\n";
+$message .= "Дата: " . date('d.m.Y H:i:s') . "\n";
+
+$headers = "From: no-reply@olimparena.aiconversion.ru\r\n";
+$headers .= "Reply-To: $email\r\n";
+$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
+
+if (mail($to, $subject, $message, $headers)) {
+ echo json_encode(["status" => "success"]);
} else {
- http_response_code(403);
- echo "Доступ запрещён";
+ error_log("Mail error: " . print_r(error_get_last(), true));
+ echo json_encode(["status" => "error", "message" => "Не удалось отправить письмо"]);
}
?>
\ No newline at end of file