|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/piltdweb1/ |
Upload File : |
<?php
$errors = '';
$myemail = '#';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['age']) ||
empty($_POST['location']) ||
empty($_POST['phone']) ||
empty($_POST['salary']) ||
empty($_POST['experience']) ||
empty($_POST['skills']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$age = $_POST['age'];
$location = $_POST['location'];
$phone = $_POST['phone'];
$salary = $_POST['salary'];
$experience = $_POST['experience'];
$skills = $_POST['skills'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}
if( empty($errors))
{
$to = $myemail;
$email_subject = "Career Application Form Submission - PILTD : $name";
$email_body = "You have received a Career Application message from PILTD Website. ".
" Here are the details:\n Name: $name \n Email: $email_address \n Age: $age \n Location: $location \n Phone: $phone \n Salary: $salary \n Experience: $experience \n Skills: $skills";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('location:http://piltd.com/thankyou.html');
}
echo nl2br($errors);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact form handler</title>
</head>
<body>
<!-- This page is displayed only if there is some error -->
</body>
</html>