173 lines
6.5 KiB
PHP
173 lines
6.5 KiB
PHP
<?php
|
|
|
|
$URlcorrection = "";
|
|
$PageTitle = "Contact Us";
|
|
$Page = "contact";
|
|
$ometa['description'] = "Warmseal Roofing: Your trusted roofing specialists in the UK, offering expert roof repairs, installations, and maintenance with quality workmanship and guaranteed results.";
|
|
$ometa['keywords'] = "roofing, roof repairs, roof installation, roofing specialists, roofing maintenance, quality workmanship, guaranteed results, UK roofing, Warmseal Roofing, contact warmseal roofing, roofing services, roofing experts, roofing contractors, roof maintenance, roof installation, roof repairs, roofing solutions, roofing company, roofing professionals, roofing estimates, roofing quotes, roofing consultations";
|
|
include_once $URlcorrection . "includes/header.php";
|
|
|
|
include_once $URlcorrection . "includes/banner.php";
|
|
include_once $URlcorrection . "includes/nav.php";
|
|
|
|
// Generate CAPTCHA numbers
|
|
$num1 = rand(1, 10);
|
|
$num2 = rand(1, 10);
|
|
$captchaAnswer = $num1 + $num2;
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
|
|
$name = trim($_POST['name']);
|
|
$email = trim($_POST['email']);
|
|
$phone = trim($_POST['phone']);
|
|
$subject = trim($_POST['subject']);
|
|
$message = trim($_POST['message']);
|
|
$captcha_input = isset($_POST['captcha']) ? (int)$_POST['captcha'] : 0;
|
|
$submittedAnswer = isset($_POST['captcha_answer']) ? (int)$_POST['captcha_answer'] : null;
|
|
|
|
if ($captcha_input !== $submittedAnswer) {
|
|
$errorMessage = "Incorrect CAPTCHA answer. Please try again.";
|
|
// Store form data for re-population
|
|
$storedName = $name;
|
|
$storedEmail = $email;
|
|
$storedPhone = $phone;
|
|
$storedSubject = $subject;
|
|
$storedMessage = $message;
|
|
} else {
|
|
$to = " enquiries@warmseal-roofing.co.uk";
|
|
$website_name = "Warmseal contact";
|
|
$from_email = "noreply@" . $_SERVER['HTTP_HOST'];
|
|
$headers = "From: " . $website_name . " <" . $from_email . ">" . "\r\n" .
|
|
"Reply-To: " . $name . " <" . $email . ">" . "\r\n" .
|
|
"X-Mailer: PHP/" . phpversion();
|
|
$body = "You have received a new message from Bedford Wealth Contact form:\n\n" .
|
|
"Name: " . $name . "\n" .
|
|
"Email: " . $email . "\n";
|
|
if (!empty($phone)) {
|
|
$body .= "Phone Number: " . $phone . "\n";
|
|
}
|
|
$body .= "Subject: " . $subject . "\n\n" .
|
|
"Message:\n" . $message;
|
|
|
|
if (mail($to, 'New Message from ' . $website_name, $body, $headers)) {
|
|
header("Location: submission");
|
|
exit();
|
|
} else {
|
|
$errorMessage = "There was an error sending your message. Please try again.";
|
|
// Store form data for re-population
|
|
$storedName = $name;
|
|
$storedEmail = $email;
|
|
$storedPhone = $phone;
|
|
$storedSubject = $subject;
|
|
$storedMessage = $message;
|
|
}
|
|
}
|
|
} else {
|
|
// Initialize stored data as empty on initial load
|
|
$storedName = '';
|
|
$storedEmail = '';
|
|
$storedPhone = '';
|
|
$storedSubject = '';
|
|
$storedMessage = '';
|
|
$errorMessage = null;
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<section class="ftco-section bg-light padding-top-100 padding-bottom-100">
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-12">
|
|
<div class="wrapper">
|
|
<div class="row no-gutters">
|
|
<div class="col-md-7 d-flex">
|
|
<div class="contact-wrap w-100 p-md-5 p-4">
|
|
<h3 class="mb-4">Get in touch</h3>
|
|
<form method="POST" id="contactForm" class="contactForm">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" name="name" id="name" placeholder="Name" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<input type="email" class="form-control" name="email" id="email" placeholder="Email" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" name="phone" id="phone" placeholder="Phone Number" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<textarea name="message" class="form-control" id="message" cols="30" rows="7" placeholder="Message" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<label for="captcha">Security Check: What is <?php echo $_SESSION['captcha']['num1']; ?> + <?php echo $_SESSION['captcha']['num2']; ?>?</label>
|
|
<input type="number" id="captcha" name="captcha" class="form-control" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<input type="submit" value="Send Message" class="btn btn-primary">
|
|
<div class="submitting"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-5 d-flex align-items-stretch">
|
|
<div class="info-wrap bg-primary w-100 p-lg-5 p-4">
|
|
<h3 class="mb-4 mt-md-4">Contact us</h3>
|
|
<div class="dbox w-100 d-flex align-items-start">
|
|
|
|
</div>
|
|
<div class="dbox w-100 d-flex align-items-center">
|
|
<div class="icon d-flex align-items-center justify-content-center">
|
|
<span class="fa fa-phone"></span>
|
|
</div>
|
|
<div class="text pl-3">
|
|
<p><span>Mobile:</span> <a href="tel:07379893869">07379893869</a></p>
|
|
<p><span>Phone:</span> <a href="tel:01254492373">01254492373</a></p>
|
|
</div>
|
|
</div>
|
|
<div class="dbox w-100 d-flex align-items-center">
|
|
<div class="icon d-flex align-items-center justify-content-center">
|
|
<span class="fa fa-paper-plane"></span>
|
|
</div>
|
|
<div class="text pl-3">
|
|
<p><span>Email:</span> <a href="mailto:info@warmseal-roofing.co.uk">info@warmseal-roofing.co.uk</a></p>
|
|
</div>
|
|
</div>
|
|
<div class="dbox w-100 d-flex align-items-center">
|
|
<div class="icon d-flex align-items-center justify-content-center">
|
|
<span class="fa fa-globe"></span>
|
|
</div>
|
|
<div class="text pl-3">
|
|
<p><span>Address:</span>Unit 9, Pheonix Works, Willows Lane, Accrington, BB5 0RT</p>
|
|
<p>Covering a 50 mile radius of Accrington, including Blackburn, Burnley, Nelson, Colne, Clitheroe, and surrounding areas.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
|
|
<?php
|
|
include_once $URlcorrection . "includes/footer.php";
|
|
?>
|