-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit_form.php
44 lines (39 loc) · 1.28 KB
/
submit_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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fullName = $_POST['full-name'];
$dob = $_POST['dob'];
$idNumber = $_POST['id-number'];
$address = $_POST['address'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$to = "josephpeterkamvabingu@gmail.com"; // Your email address
$subject = "Job Application - " . $fullName;
$message = "
<html>
<head>
<title>Job Application</title>
</head>
<body>
<h2>Job Application Form Submission</h2>
<p><strong>Full Name:</strong> $fullName</p>
<p><strong>Date of Birth:</strong> $dob</p>
<p><strong>ID Number:</strong> $idNumber</p>
<p><strong>Address:</strong> $address</p>
<p><strong>Email Address:</strong> $email</p>
<p><strong>Phone Number:</strong> $phone</p>
</body>
</html>
";
// Set content-type header for sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8" . "\r\n";
// Additional headers
$headers .= "From: $email" . "\r\n";
// Send email
if (mail($to, $subject, $message, $headers)) {
echo "Thank you for your application. We will get in touch with you soon.";
} else {
echo "Sorry, there was an error sending your application.";
}
}
?>