Advertisement
Guest User

Untitled

a guest
Dec 28th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. <?php include('header.php')?>
  2. <?php include('slider.php')?>
  3. <!-- Main start -->
  4. <div class="main_part">
  5. <div class="container">
  6. <div class="row">
  7. <div class="main about">
  8.  
  9. <h2>Contact with us</h2>
  10.  
  11. <div class="col-sm-6 col-md-6 col-lg-6">
  12. <div class="main-right about-cont">
  13. <h1>Contact Details</h1>
  14. <h3>Office:</h3>
  15. House # 22, Shantinagar, Dhaka-1217, Bangladesh. <br>
  16. Phone: +88 01711 322 299<br>
  17. e-mail: <a href="mailto:mdshakhawtath0@gmail.com">mdshakhawtath0@gmail.com</a><br>
  18.  
  19. <h3>Factory: </h3>
  20. <strong>A-TEX Label Industries Ltd.(Woven Label)(Oeko-tex-100 Standard Certificate) :</strong>
  21. Plot # 799, Dhananjoypur, (Amtola Katgora) Zirabo, Savar, Dhaka.<br><br>
  22.  
  23. <strong>United Poly Factory:</strong> Zamgara, P.O. Gazirchat Alia Madrasha Ashulia, Dhaka. <br><br>
  24. <strong>Akota Printing & Press:</strong> 102, Arambagh, Post Office Line, Motijheel, Dhaka.
  25. </div>
  26. </div>
  27.  
  28. <div class="col-sm-6 col-md-6 col-lg-6">
  29. <div class="main-right about-cont">
  30. <h1>Business Enquiry Form</h1>
  31. <!--<form action="" name="contactform" method="post">
  32. <input name="name" type="text" class="form-control rs-input" placeholder="Please Enter Your Name...">
  33. <input name="email" type="email" class="form-control rs-input" placeholder="Please Enter Your Email...">
  34. <input name="telephone" type="text" class="form-control rs-input" placeholder="Please Enter Your Phone Number...">
  35. <input name="subject" type="text" class="form-control rs-input" placeholder="Please Enter Your Subject...">
  36. <textarea name="comments" class="form-control rs-input" placeholder="Please Enter Your Message..." cols="30" rows="4"></textarea>
  37. <input type="submit" value="Submit" class="btn btn-primary rs-input">
  38. </form>-->
  39. <form name="contactform" method="post" action="">
  40. <input name="first_name" type="text" class="form-control rs-input" placeholder="Please Enter Your First Name...">
  41. <input type="text" name="last_name" class="form-control rs-input" placeholder="Please Enter Your First Name...">
  42. <input name="email" type="email" class="form-control rs-input" placeholder="Please Enter Your Email...">
  43. <input name="telephone" type="text" class="form-control rs-input" placeholder="Please Enter Your Phone Number...">
  44. <textarea name="comments" class="form-control rs-input" placeholder="Please Enter Your Message..." cols="30" rows="4"></textarea>
  45. <input type="submit" value="Submit" class="btn btn-primary rs-input">
  46. </form>
  47. <?php
  48.  
  49. if(isset($_POST['email'])) {
  50.  
  51.  
  52.  
  53. // EDIT THE 2 LINES BELOW AS REQUIRED
  54.  
  55. $email_to = "riponsarker60@gmail.com";
  56.  
  57. $email_subject = "United Accessories";
  58.  
  59.  
  60.  
  61.  
  62.  
  63. function died($error) {
  64.  
  65. // your error code can go here
  66.  
  67. echo "We are very sorry, but there were error(s) found with the form you submitted. ";
  68.  
  69. echo "These errors appear below.<br /><br />";
  70.  
  71. echo $error."<br /><br />";
  72.  
  73. echo "Please go back and fix these errors.<br /><br />";
  74.  
  75. die();
  76.  
  77. }
  78.  
  79.  
  80.  
  81. // validation expected data exists
  82.  
  83. if(!isset($_POST['first_name']) ||
  84.  
  85. !isset($_POST['last_name']) ||
  86.  
  87. !isset($_POST['email']) ||
  88.  
  89. !isset($_POST['telephone']) ||
  90.  
  91. !isset($_POST['comments'])) {
  92.  
  93. died('We are sorry, but there appears to be a problem with the form you submitted.');
  94.  
  95. }
  96.  
  97.  
  98.  
  99. $first_name = $_POST['first_name']; // required
  100.  
  101. $last_name = $_POST['last_name']; // required
  102.  
  103. $email_from = $_POST['email']; // required
  104.  
  105. $telephone = $_POST['telephone']; // not required
  106.  
  107. $comments = $_POST['comments']; // required
  108.  
  109.  
  110.  
  111. $error_message = "";
  112.  
  113. $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  114.  
  115. if(!preg_match($email_exp,$email_from)) {
  116.  
  117. $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  118.  
  119. }
  120.  
  121. $string_exp = "/^[A-Za-z .'-]+$/";
  122.  
  123. if(!preg_match($string_exp,$first_name)) {
  124.  
  125. $error_message .= 'The First Name you entered does not appear to be valid.<br />';
  126.  
  127. }
  128.  
  129. if(!preg_match($string_exp,$last_name)) {
  130.  
  131. $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  132.  
  133. }
  134.  
  135. if(strlen($comments) < 2) {
  136.  
  137. $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  138.  
  139. }
  140.  
  141. if(strlen($error_message) > 0) {
  142.  
  143. died($error_message);
  144.  
  145. }
  146.  
  147. $email_message = "Form details below.\n\n";
  148.  
  149.  
  150.  
  151. function clean_string($string) {
  152.  
  153. $bad = array("content-type","bcc:","to:","cc:","href");
  154.  
  155. return str_replace($bad,"",$string);
  156.  
  157. }
  158.  
  159.  
  160.  
  161. $email_message .= "First Name: ".clean_string($first_name)."\n";
  162.  
  163. $email_message .= "Last Name: ".clean_string($last_name)."\n";
  164.  
  165. $email_message .= "Email: ".clean_string($email_from)."\n";
  166.  
  167. $email_message .= "Telephone: ".clean_string($telephone)."\n";
  168.  
  169. $email_message .= "Comments: ".clean_string($comments)."\n";
  170.  
  171.  
  172.  
  173.  
  174.  
  175. // create email headers
  176.  
  177. $headers = 'From: '.$email_from."\r\n".
  178.  
  179. 'Reply-To: '.$email_from."\r\n" .
  180.  
  181. 'X-Mailer: PHP/' . phpversion();
  182.  
  183. @mail($email_to, $email_subject, $email_message, $headers);
  184.  
  185. ?>
  186.  
  187.  
  188.  
  189. <!-- include your own success html here -->
  190.  
  191.  
  192.  
  193. Thank you for contacting us. We will be in touch with you very soon.
  194.  
  195.  
  196.  
  197. <?php
  198.  
  199. }
  200.  
  201. ?>
  202.  
  203. </div>
  204. </div>
  205.  
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <!-- Main end -->
  211.  
  212. <?php include('footer.php')?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement