Guest User

Untitled

a guest
May 24th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. /* Здесь проверяется существование переменных */
  2. if (isset($_POST['name'])) {$name = $_POST['name'];}
  3. if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
  4. if (isset($_POST['ques'])) {$phone = $_POST['ques'];}
  5.  
  6.  
  7.  
  8. /* Сюда впишите свою эл. почту */
  9. $address = "madest4815@gmail.com";
  10.  
  11. /* А здесь прописывается текст сообщения, n - перенос строки */
  12. $mes = "Тема: Заказ обратного звонка!nТелефон: $phonenВопрос: $quesnИмя: $name ";
  13.  
  14. /* А эта функция как раз занимается отправкой письма на указанный вами email */
  15. $sub='Заказ'; //сабж
  16. $email='Заказ <ОКНА ПВХ>'; // от кого
  17. $send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = utf-8rnFrom:$email");
  18.  
  19. ini_set('short_open_tag', 'On');
  20. header('Refresh: 3; URL=index.html');
  21. ?>
  22. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  23. <html>
  24. <head>
  25. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  26. <meta http-equiv="refresh" content="3; url=index.htm">
  27. <title>С вами свяжутся</title>
  28. <meta name="generator">
  29. <style type="text/css">
  30. body
  31. {
  32.  
  33. background: #22BFF7 url(img/zakaz.jpg) top -70% center no-repeat;
  34.  
  35. }
  36.  
  37. <script type="text/javascript">
  38. setTimeout('location.replace("/index.htm")', 3000);
  39. /*Изменить текущий адрес страницы через 3 секунды (3000 миллисекунд)*/
  40. </script>
  41. </head>
  42. </body>
  43. </html>
  44.  
  45. $('.button').click(function() {
  46. var msg = $('#formx').serialize();
  47. $.ajax({
  48. type: 'POST',
  49. url: 'res.php',
  50. data: msg,
  51. success: function(data) {
  52. $('.results').html(data);
  53. },
  54. error: function(xhr, str){
  55. alert('Возникла ошибка: ' + xhr.responseCode);
  56. }
  57. });
  58.  
  59. }
  60.  
  61. $name ="";
  62. $phone ="";
  63. $ques ="";
  64.  
  65. if (isset($_POST['name'])) {$name = $_POST['name']; }
  66.  
  67. if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
  68. if (isset($_POST['phone2'])) {$phone.= $_POST['phone2'];}
  69. if (isset($_POST['phone3'])) {$phone.= $_POST['phone3'];}
  70.  
  71. if (isset($_POST['ques'])) {$ques = $_POST['ques']; }
  72. echo "name = ".$name."phone= ".$phone."ques= ".$ques;
Add Comment
Please, Sign In to add comment