Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. <!---------------------------------
  2. CUSTOM WEBSITE DESIGN BY CRAIG VENTURES
  3. VISIT OUR WEBSITE AT CRAIGVENTURES.COM
  4. ---------------------------------->
  5.  
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9.  
  10. <title>JT Wills - Home</title>
  11.  
  12. <?php
  13. include ('includes/header.php');
  14. ?>
  15.  
  16. <meta name="description" content="#">
  17. <meta name="keywords" content="#">
  18.  
  19. </head>
  20. <body>
  21.  
  22. <?php
  23. $active = "Home";
  24. include ('includes/nav.php');
  25. ?>
  26.  
  27. <div class="container">
  28. <img class="main-cover-img img-rounded" alt="Cover" src="img/cover.jpg" />
  29. <div class="spacer"></div>
  30. <h1 class="title contact-title">&nbsp;Contact Me&nbsp;</h1>
  31. <div class="spacer"></div>
  32. <div class="row">
  33. <a name="contact"></a>
  34. <div class="col-md-4">
  35. <br />
  36. <div class="row">
  37. <div class="col-md-3">
  38. <a href="https://jtwills.co.uk" target="_blank">
  39. <div class="mobicon"><img class="contacticon" src="img/browser.png"></div>
  40. </a>
  41. </div>
  42. <div class="col-md-9">
  43. <a class="contacttext" href="https://jtwills.co.uk" target="_blank">
  44. <p class="contacttext">jtwills.co.uk</p>
  45. </a>
  46. </div>
  47. </div>
  48. <br />
  49. <div class="row">
  50. <div class="col-md-3">
  51. <a href="mailto:me@jtwills.co.uk?subject=Website%20Enquiry%20(jtwills.co.uk)&body=Name%3A%0D%0AMessage%3A">
  52. <div class="mobicon"><img class="contacticon" src="img/mail.png"></div>
  53. </a>
  54. </div>
  55. <div class="col-md-9">
  56. <a class="contacttext" href="mailto:me@jtwills.co.uk?subject=Website%20Enquiry%20(jtwills.co.uk)&body=Name%3A%0D%0AMessage%3A">
  57. <p class="contacttext">me@jtwills.co.uk</p>
  58. </a>
  59. </div>
  60. </div>
  61. <br />
  62. <div class="row">
  63. <div class="col-md-3">
  64. <a href="https://www.youtube.com/channel/UCIFXkvEltpLnMzJvmn1YTxg" target="_blank">
  65. <div class="mobicon"><img class="contacticon" src="img/youtube.png"></div>
  66. </a>
  67. </div>
  68. <div class="col-md-9">
  69. <a class="contacttext" href="https://www.youtube.com/channel/UCIFXkvEltpLnMzJvmn1YTxg" target="_blank">
  70. <p class="contacttext">JT Wills</p>
  71. </a>
  72. </div>
  73. </div>
  74. <br />
  75. <div class="row">
  76. <div class="col-md-3">
  77. <a href="https://m.facebook.com/JTWvlogs/" target="_blank">
  78. <div class="mobicon"><img class="contacticon" src="img/facebook.png"></div>
  79. </a>
  80. </div>
  81. <div class="col-md-9">
  82. <a class="contacttext" href="https://m.facebook.com/JTWvlogs/" target="_blank">
  83. <p class="contacttext">JTW VLogs</p>
  84. </a>
  85. </div>
  86. </div>
  87.  
  88. </div>
  89. <div class="col-md-8">
  90. <?php
  91.  
  92. if(!empty($_POST)) {
  93. require 'phpmailer/PHPMailerAutoload.php';
  94.  
  95. $mail = new PHPMailer;
  96.  
  97. //$mail->SMTPDebug = 3; // Enable verbose debug output
  98.  
  99. $mail->isSMTP(); // Set mailer to use SMTP
  100. $mail->Host = 'mail3.gridhost.co.uk'; // Specify SMTP server
  101. $mail->SMTPAuth = true; // Enable SMTP authentication
  102. $mail->Username = 'noreply@jtwills.co.uk'; // SMTP username
  103. $mail->Password = 'Dench10'; // SMTP password
  104. $mail->SMTPSecure = 'ssl'; // ssl/tls accepted
  105. $mail->Port = 465; // TCP port to connect to
  106.  
  107. $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
  108. $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
  109. $department = filter_var($_POST['department'], FILTER_SANITIZE_STRING);
  110. $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
  111. if (empty($name) || empty($email) || empty($department) || empty($description)) {
  112. echo "Name, email and message required, please correct the errors and resubmit.";
  113. }else {
  114. if ($department == "General") {
  115. $to = "me@jtwills.co.uk";
  116. }
  117. else if ($department == "Requests") {
  118. $to = "me@jtwills.co.uk";
  119. }
  120. else if ($department == "Issues") {
  121. $to = "peter@craigventures.com";
  122. }
  123. else {
  124. $to = "contact@dnbfan.club";
  125. }
  126. $mail->addAddress($to);
  127. $mail->Subject = "Contact Form Submission (jtwills.co.uk)";
  128. $mail->setFrom($email, $name);
  129. $mail->addReplyTo($email);
  130. $mail->isHTML(true);
  131. $message = "<html><body>";
  132. $message .= "<b>Name: </b>$name<br>
  133. <b>Email: </b> $email<br>
  134. <b>Subject: </b> $department<br>
  135. <b>Message: </b> $description
  136. ";
  137. $message .= "</body></html>";
  138. $mail->Body = $message;
  139. if(!$mail->send()) {
  140. echo 'Message could not be sent.';
  141. echo 'Mailer Error: ' . $mail->ErrorInfo;
  142. } else {
  143. 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>";
  144. }
  145. }
  146. }
  147. ?>
  148.  
  149. <div class="row">
  150.  
  151. <form class="col-xs-12" action="" method="post" name="contact" id="contact-form">
  152. <div class="field-group row">
  153. <div class="field col-sm-4">
  154. <h5>Your Name</h5>
  155. <input name="name" type="text" class="form-control" title="Please type your name." placeholder="Name..." required>
  156. </div>
  157. <div class="field col-sm-4">
  158. <h5>Your Email</h5>
  159. <input name="email" type="text" class="form-control" title="Please type your email." placeholder="Email..." required>
  160. </div>
  161. <div class="field col-sm-4">
  162. <h5>Subject</h5>
  163. <select class="form-control" name="department" id="Department">
  164. <option value="General">General</option>
  165. <option value="Requests">Requests</option>
  166. <option value="Issues">Website Issues</option>
  167. </select>
  168. </div>
  169. </div>
  170. <div class="field">
  171. <h5>Your Message</h5>
  172. <textarea name="description" rows="5" class="form-control" placeholder="Message..." title="Please type a message."></textarea>
  173. </div>
  174. <br />
  175. <button type="submit" class="btn">Send Message</button>
  176. <h6><b>Note:</b> Please wait 3-5 seconds after clicking.</h6>
  177.  
  178. </form>
  179. </div>
  180.  
  181. </div>
  182. </div>
  183. </div>
  184. <div class="spacer"></div>
  185. <?php
  186. include ('includes/footer.php');
  187. ?>
  188.  
  189. </body>
  190. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement