BLACKSITE
:
216.73.216.62
:
147.93.18.13 / vinyasaweddings.com
:
Linux srv667811 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
:
/
var
/
www
/
vinyasawedding
/
Upload File:
files >> /var/www/vinyasawedding/submit_enquiry.php
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); file_put_contents('php://stderr', "Raw POST: " . file_get_contents("php://input") . PHP_EOL, FILE_APPEND); require_once 'db.php'; header('Content-Type: application/json'); if ($_SERVER["REQUEST_METHOD"] == "POST") { $data = json_decode(file_get_contents("php://input"), true); $name = $data['name'] ?? ''; $phone = $data['phone'] ?? ''; $event_type = $data['event_type'] ?? ''; $attendees = $data['attendees'] ?? ''; $email = $data['email'] ?? ''; $message = $data['message'] ?? ''; if (!$name || !$phone || !$event_type || !$attendees || !$email) { echo json_encode(["success" => false, "message" => "All fields are required."]); exit; } $stmt = $db->prepare("INSERT INTO enquiry (name, phone, event_type, attendees, email, message) VALUES (?, ?, ?, ?, ?, ?)"); $insertSuccess = $stmt->execute([$name, $phone, $event_type, $attendees, $email, $message]); if ($insertSuccess) { // Send email via Node service $ch = curl_init('https://mail.webythink.com/vinyasa/send-mail'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $result = json_decode($response, true); if ($httpCode == 200 && isset($result['success']) && $result['success']) { echo json_encode(["success" => true, "message" => "Enquiry submitted successfully!"]); } else { echo json_encode(["success" => true, "message" => "Enquiry saved, but email failed to send."]); } } else { echo json_encode(["success" => false, "message" => "Failed to save enquiry."]); } } ?>