-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_form.php
25 lines (23 loc) · 1012 Bytes
/
process_form.php
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
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$business_name = $_POST['business_name'];
$business_website = $_POST['business_website'];
$email = $_POST['email'];
$budget = $_POST['budget'];
$time_allowance = $_POST['time_allowance'];
$package_options = $_POST['package_options'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// Send an email (example)
$to = "[email protected]"; "[email protected]";
$headers = "From: $email";
$body = "New Project Inquiry:\n\nName: $first_name $last_name\nBusiness: $business_name\nWebsite: $business_website\nEmail: $email\nBudget: $budget\nTime Allowance: $time_allowance\nPackage: $package_options\nSubject: $subject\nMessage: $message";
if (mail($to, $subject, $body, $headers)) {
echo "Your form was successfully submitted!";
} else {
echo "Error submitting form. Please try again.";
}
}
?>