Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!---------------------------------
- CUSTOM WEBSITE DESIGN BY CRAIG VENTURES
- VISIT OUR WEBSITE AT CRAIGVENTURES.COM
- ---------------------------------->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>JT Wills - Home</title>
- <?php
- include ('includes/header.php');
- ?>
- <meta name="description" content="#">
- <meta name="keywords" content="#">
- </head>
- <body>
- <?php
- $active = "Home";
- include ('includes/nav.php');
- ?>
- <div class="container">
- <img class="main-cover-img img-rounded" alt="Cover" src="img/cover.jpg" />
- <div class="spacer"></div>
- <h1 class="title contact-title"> Contact Me </h1>
- <div class="spacer"></div>
- <div class="row">
- <a name="contact"></a>
- <div class="col-md-4">
- <br />
- <div class="row">
- <div class="col-md-3">
- <a href="https://jtwills.co.uk" target="_blank">
- <div class="mobicon"><img class="contacticon" src="img/browser.png"></div>
- </a>
- </div>
- <div class="col-md-9">
- <a class="contacttext" href="https://jtwills.co.uk" target="_blank">
- <p class="contacttext">jtwills.co.uk</p>
- </a>
- </div>
- </div>
- <br />
- <div class="row">
- <div class="col-md-3">
- <a href="mailto:me@jtwills.co.uk?subject=Website%20Enquiry%20(jtwills.co.uk)&body=Name%3A%0D%0AMessage%3A">
- <div class="mobicon"><img class="contacticon" src="img/mail.png"></div>
- </a>
- </div>
- <div class="col-md-9">
- <a class="contacttext" href="mailto:me@jtwills.co.uk?subject=Website%20Enquiry%20(jtwills.co.uk)&body=Name%3A%0D%0AMessage%3A">
- <p class="contacttext">me@jtwills.co.uk</p>
- </a>
- </div>
- </div>
- <br />
- <div class="row">
- <div class="col-md-3">
- <a href="https://www.youtube.com/channel/UCIFXkvEltpLnMzJvmn1YTxg" target="_blank">
- <div class="mobicon"><img class="contacticon" src="img/youtube.png"></div>
- </a>
- </div>
- <div class="col-md-9">
- <a class="contacttext" href="https://www.youtube.com/channel/UCIFXkvEltpLnMzJvmn1YTxg" target="_blank">
- <p class="contacttext">JT Wills</p>
- </a>
- </div>
- </div>
- <br />
- <div class="row">
- <div class="col-md-3">
- <a href="https://m.facebook.com/JTWvlogs/" target="_blank">
- <div class="mobicon"><img class="contacticon" src="img/facebook.png"></div>
- </a>
- </div>
- <div class="col-md-9">
- <a class="contacttext" href="https://m.facebook.com/JTWvlogs/" target="_blank">
- <p class="contacttext">JTW VLogs</p>
- </a>
- </div>
- </div>
- </div>
- <div class="col-md-8">
- <?php
- if(!empty($_POST)) {
- require 'phpmailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'mail3.gridhost.co.uk'; // Specify SMTP server
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'noreply@jtwills.co.uk'; // SMTP username
- $mail->Password = 'Dench10'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // ssl/tls accepted
- $mail->Port = 465; // TCP port to connect to
- $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
- $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
- $department = filter_var($_POST['department'], FILTER_SANITIZE_STRING);
- $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
- if (empty($name) || empty($email) || empty($department) || empty($description)) {
- echo "Name, email and message required, please correct the errors and resubmit.";
- }else {
- if ($department == "General") {
- $to = "me@jtwills.co.uk";
- }
- else if ($department == "Requests") {
- $to = "me@jtwills.co.uk";
- }
- else if ($department == "Issues") {
- $to = "peter@craigventures.com";
- }
- else {
- $to = "contact@dnbfan.club";
- }
- $mail->addAddress($to);
- $mail->Subject = "Contact Form Submission (jtwills.co.uk)";
- $mail->setFrom($email, $name);
- $mail->addReplyTo($email);
- $mail->isHTML(true);
- $message = "<html><body>";
- $message .= "<b>Name: </b>$name<br>
- <b>Email: </b> $email<br>
- <b>Subject: </b> $department<br>
- <b>Message: </b> $description
- ";
- $message .= "</body></html>";
- $mail->Body = $message;
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo "<div class='alert alert-success'><h4>Success!</h4> Your message has been sent and we aim to get back to you within 24 hours.</div>";
- }
- }
- }
- ?>
- <div class="row">
- <form class="col-xs-12" action="" method="post" name="contact" id="contact-form">
- <div class="field-group row">
- <div class="field col-sm-4">
- <h5>Your Name</h5>
- <input name="name" type="text" class="form-control" title="Please type your name." placeholder="Name..." required>
- </div>
- <div class="field col-sm-4">
- <h5>Your Email</h5>
- <input name="email" type="text" class="form-control" title="Please type your email." placeholder="Email..." required>
- </div>
- <div class="field col-sm-4">
- <h5>Subject</h5>
- <select class="form-control" name="department" id="Department">
- <option value="General">General</option>
- <option value="Requests">Requests</option>
- <option value="Issues">Website Issues</option>
- </select>
- </div>
- </div>
- <div class="field">
- <h5>Your Message</h5>
- <textarea name="description" rows="5" class="form-control" placeholder="Message..." title="Please type a message."></textarea>
- </div>
- <br />
- <button type="submit" class="btn">Send Message</button>
- <h6><b>Note:</b> Please wait 3-5 seconds after clicking.</h6>
- </form>
- </div>
- </div>
- </div>
- </div>
- <div class="spacer"></div>
- <?php
- include ('includes/footer.php');
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement