Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. $(document).ready(function(){
  2. $(".show").click(function (){
  3. $(".web, .about, .tel, .email").hide();
  4. $("." + $(this).attr("show-class")).fadeIn("fast");
  5. });
  6. });
  7.  
  8. <li><a href="#" class="show" show-class="email">E-mail</a></li>
  9.  
  10. <div class="email">
  11.  
  12. <form method="post" action="">
  13. <input name="name" placeholder="Name (required)">
  14. <input name="email" type="email" placeholder="E-mail (required)">
  15. <textarea name="message" placeholder="Message"></textarea>
  16. <input name="submit" type="submit" value="Submit">
  17. </form>
  18.  
  19. <?php
  20.  
  21. $name = $_POST['name'];
  22. $email = $_POST['email'];
  23. $message = $_POST['message'];
  24. $to = 'example@example.com';
  25. $subject = 'Hi! From Example.com';
  26.  
  27. $body = "From: $namen E-Mail: $emailn Message:n $message";
  28.  
  29. if ($_POST['submit']) {
  30. if ($name != '' && $email != '') {
  31. if (mail ($to, $subject, $body)) {
  32. echo '<p>Your message has been sent.</p>';
  33. } else {
  34. echo '<p>Something went wrong, go back and try again.</p>';
  35. }
  36. } else {
  37. echo '<p>Please fill in required information.</p>';
  38. }
  39. }
  40. ?>
  41.  
  42. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement