-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_inquiry.php
More file actions
29 lines (27 loc) · 1.16 KB
/
process_inquiry.php
File metadata and controls
29 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Get form data
$name = $_POST['name'];
$email = $_POST['email'];
$car = $_POST['car'];
$service = $_POST['Select_a_Service'];
$date = $_POST['date'];
$time = $_POST['time'];
$message = $_POST['message'];
// You can perform further validation and data processing here
// For this example, we'll just display a response message
echo "<h2>Form Submission Confirmation</h2>";
echo "<p>Thank you, $name, for your inquiry!</p>";
echo "<p>You're interested in a $car and would like to $service on $date at $time.</p>";
echo "<p>We've received your message:</p>";
echo "<p><em>$message</em></p>";
} elseif ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['success']) && $_GET['success'] === 'true') {
// Display a success message if redirected from process_inquiry.php
echo "<h2>Success!</h2>";
echo "<p>Your inquiry has been sent.</p>";
echo "<p>We'll get back to you shortly.</p>";
} else {
// Handle invalid requests (direct access to the script without form submission)
echo "Invalid request. Please submit the form from the inquiry page.";
}
?>