|
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/digital/ |
Upload File : |
<?php
$errors = '';
$myemail = '[email protected]';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['lname']) ||
empty($_POST['cname']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['mobile']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$lname = $_POST['lname'];
$cname = $_POST['cname'];
$email_address = $_POST['email'];
$phone = $_POST['phone'];
$mobile = $_POST['mobile'];
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 = "Contact Form Submission - PILTD : $name";
$email_body = "You have received a Contact message from PILTD Website. ".
" Here are the details:\n Name: $name \n Last Name: $lname \n Company Name: $cname \n Email: $email_address \n Phone: $phone \n Mobile: $mobile";
$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://108.26.234.213/digital/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>