SHARE
TWEET

Untitled

a guest May 19th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     $(document).ready(function(){
  3.  
  4.         $("form").submit(function(){
  5.             $.ajax({
  6.                 method: "POST",
  7.                 url: "mail.php",
  8.                 data: $(this).serialize()  
  9.             }).done(function(){
  10.                 $("input[name=name]").val("");
  11.                 $("input[name=tel]").val("");
  12.                 window.location.href="thankyou.html";
  13.             });
  14.             return false;
  15.         });
  16.     });
  17. </script>
  18.  
  19. <?php
  20.    
  21.     $recepient = "olya_ermash@mail.ru";
  22.     $sitename = "Northern Tales";
  23.  
  24.     $name = $_POST['name'];
  25.     $tel = $_POST['tel'];
  26.  
  27.     $message = "Имя: $name \n Телефон: $tel";
  28.  
  29.     $pagetitle = "Заявка с сайта \"$sitename\"";
  30.     mail($recepient, $pagetitle, $message);
  31.     // mail(куда, заголовок письма, тело письма)
  32. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top