you have left a brace after else now use this code
<?php
// define variables and set to empty values
$lnameErr = $emailErr = $fnameErr = "";
$fname = $emailaddr = $lname = $phone = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["fname"])) {
$fnameErr = "First name is required";
}
else {
$fname = test_input($_POST["fname"]);
// check if name only contains letters and whitespace for first name
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["lname"])) {
$lnameErr = "Last name is required";
}
else {
$lname = test_input($_POST["lname"]);
// check if name only contains letters and whitespace for last name
if (!preg_match("/^[a-zA-Z ]*$/",$lname)) {
$lnameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["email"])) {
$emailErr = "Email is required";
}
else {
$email = test_input($_POST["email"]);
// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}
}
// Passes input to email
else {
(isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['email'])
&& isset($_POST['phone']) && isset($_POST['county']) && isset($_POST['floor'])
&& isset($_POST['descr'])); {
$data = $_POST['firstname'] . ' ' . $_POST['lastname'] . "\n" .
$_POST['email'] . "\n" . $_POST['phone'] . "\n" .
$_POST['county'] . "\n" . $_POST['floor'] . "\n" . $_POST['descr'] . "\n";
mail('craftsllc1@gmail.com', 'Estimation Inquery', $data);
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
echo "Thank you for your inquery! <br/> An estimator will be with right with you";
?>
this is where you missed the curly brace
// Passes input to email
else {
(isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['email'])
&& isset($_POST['phone']) && isset($_POST['county']) && isset($_POST['floor'])
&& isset($_POST['descr'])); {
$data = $_POST['firstname'] . ' ' . $_POST['lastname'] . "\n" .
$_POST['email'] . "\n" . $_POST['phone'] . "\n" .
$_POST['county'] . "\n" . $_POST['floor'] . "\n" . $_POST['descr'] . "\n";
mail('craftsllc1@gmail.com', 'Estimation Inquery', $data);
}
} // this is brace you missed